Made sockets nonblocking (I'm a fool who didn't do this and spent several hours trying to figure out why I couldn't handle a second request if firefox was on the page I'm so dumb I hate myself I hate coding I hate the internet computers were a mistake)
This commit is contained in:
@@ -91,7 +91,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Stream *acceptStream(Listener *listener) {
|
||||
Stream *acceptStream(Listener *listener, int flags) {
|
||||
Stream *ret = malloc(sizeof(Stream));
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
@@ -104,6 +104,9 @@ Stream *acceptStream(Listener *listener) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int oldflags = fcntl(ret->fd, F_GETFL);
|
||||
fcntl(ret->fd, F_SETFL, oldflags | flags);
|
||||
|
||||
switch (listener->type) {
|
||||
case TCP: default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user