Cross-platform code improvements.

This commit is contained in:
Jordan Bancino 2023-03-01 01:55:26 +00:00
parent 2e1220621c
commit e7d1c0d951

View file

@ -287,7 +287,7 @@ HttpServerCreate(unsigned short port, unsigned int nThreads, unsigned int maxCon
HttpHandler * requestHandler, void *handlerArgs)
{
HttpServer *server;
struct sockaddr_in sa = {0};
struct sockaddr_in sa;
if (!requestHandler)
{
@ -343,6 +343,8 @@ HttpServerCreate(unsigned short port, unsigned int nThreads, unsigned int maxCon
}
#endif
memset(&sa, 0, sizeof(struct sockaddr_in));
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
sa.sin_addr.s_addr = htonl(INADDR_ANY);
@ -553,7 +555,7 @@ HttpServerWorkerThread(void *args)
break;
}
line[i] = tolower(line[i]);
line[i] = tolower((unsigned char) line[i]);
}
headerKey = Malloc((i + 1) * sizeof(char));