Fix working with empty query

master
Mikhail Novosyolov 3 years ago
parent beee4d129b
commit fffcfd02fd
  1. 8
      webserver/doskast-trigger-connect.c

@ -97,12 +97,10 @@ main(){
}
s_cgi *cgi;
while(FCGI_Accept() >= 0) {
// cgiReadVariables() returns NULL if QUESRY_STRING is empty,
// and it is empty when neither width not height are defined,
// so checking its return value is useless.
cgi = cgiInit();
if (cgi == NULL) {
fprintf(stderr, "%s\n", "Error initializaing CGI");
http_code = HTTP_ERROR;
goto fcgi_out;
}
char *ip = getenv("REMOTE_ADDR");
if (ip == NULL) {
fprintf(stderr, "%s\n", "Env REMOTE_ADDR is not set");

Loading…
Cancel
Save