Fixed ridiculous CPU usage

This commit is contained in:
Nate Choe
2022-01-25 05:10:04 -06:00
parent 96794b2696
commit 6bbfb59d34
5 changed files with 73 additions and 79 deletions

View File

@@ -50,8 +50,6 @@ typedef struct Connection {
size_t bodylen;
size_t receivedBody;
struct Connection *next;
char *currLine;
//persistent
size_t currLineAlloc;
@@ -62,7 +60,7 @@ typedef struct Connection {
//Ephemeral fields: Things which are freed and reallocated after each new
//request, path, body
Connection *newConnection(int fd);
int newConnection(int fd, Connection *ret);
//returns non-zero on error. creates a new connection bound to fd
void resetConnection(Connection *conn);
void freeConnection(Connection *conn);