* tcp_sockets.c: getservbyname() doesn't set errno.
and port
* converted to autoconf and began port to Digital UNIX
* warning fixes
+ * context_loop.c: moved the monster 64k buffer array off the stack
+ * tcp_sockets.c: getservbyname() doesn't set errno.
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
* This loop gets called once for every HTTP connection made to WebCit.
*/
void *context_loop(int sock) {
- char req[256][256];
+ char (*req)[256];
char buf[256], hold[256];
int num_lines = 0;
int a;
int ContentLength;
int CloseSession = 0;
+ if ((req = malloc(sizeof(char[256][256]))) == NULL) {
+ printf("Can't malloc buffers; dropping connection.\n");
+ close (sock);
+ return NULL;
+ }
+
printf("Reading request from socket %d\n", sock);
/*
sin.sin_port = pse->s_port;
}
else if ((sin.sin_port = htons((u_short)atoi(service))) == 0) {
- fprintf(stderr,"can't get %s service entry: %s\n",
- service,strerror(errno));
+ fprintf(stderr,"can't get %s service entry\n", service);
return(-1);
}