diff --git a/test/mt_web_server.cpp b/test/mt_web_server.cpp index e5ebba8..31c217d 100644 --- a/test/mt_web_server.cpp +++ b/test/mt_web_server.cpp @@ -43,6 +43,7 @@ #include // #include // #include // +#include #endif /* ------------------------------------------------------------------------ */ @@ -93,7 +94,7 @@ int main(void) unsigned int client_s; // Client socket descriptor struct sockaddr_in client_addr; // Client Internet address struct in_addr client_ip_addr; // Client IP address - int addr_len; // Internet address length + socklen_t addr_len; // Internet address length /* FOR UNIX/LINUX ------------------------------------------------------ */ #ifdef UNIX @@ -118,7 +119,7 @@ int main(void) // Main loop to listen, accept, and then spin-off a thread to handle the GET while (1) { - // Listen for connections and then accept + // Listen for connections and then accept listen(server_s, 100); addr_len = sizeof(client_addr); @@ -135,7 +136,7 @@ int main(void) nChild_proc_id = fork(); // Separate the parent and child process here ... - if (nChild_proc_id == -1) // if I am a new child, go to the child module. + if (nChild_proc_id == 0) // if I am a new child, go to the child module. { child_proc(server_s, client_s); }