--- parser3/src/main/pa_http.C 2020/12/17 11:50:44 1.112 +++ parser3/src/main/pa_http.C 2020/12/19 22:34:21 1.114 @@ -14,7 +14,7 @@ #include "pa_vfile.h" #include "pa_random.h" -volatile const char * IDENT_PA_HTTP_C="$Id: pa_http.C,v 1.112 2020/12/17 11:50:44 moko Exp $" IDENT_PA_HTTP_H; +volatile const char * IDENT_PA_HTTP_C="$Id: pa_http.C,v 1.114 2020/12/19 22:34:21 moko Exp $" IDENT_PA_HTTP_H; #ifdef _MSC_VER #include @@ -1224,10 +1224,13 @@ bool HTTPD_Connection::accept(int server } HTTPD_Server::HTTPD_MODE HTTPD_Server::mode = HTTPD_Server::SEQUENTIAL; +const char *HTTPD_Server::port=NULL; void HTTPD_Server::set_mode(const String &value){ if(value == "sequental") mode = SEQUENTIAL; +#ifdef HAVE_TLS else if (value == "threaded") mode = MULTITHREADED; +#endif #ifdef _MSC_VER else throw Exception("httpd.mode", &value, "$main:HTTPD.mode must be 'sequental' or 'threaded'"); #else @@ -1239,10 +1242,11 @@ void HTTPD_Server::set_mode(const String int HTTPD_Server::bind(const char *host_port){ struct sockaddr_in me; - const char *port = strchr(host_port, ':'); + port = strchr(host_port, ':'); const char *host = NULL; - if(port && port > host_port){ - host = pa_strdup(host_port, port - host_port); + if(port ){ + if(port > host_port) + host = pa_strdup(host_port, port - host_port); port += 1; } else { port = host_port;