From 3ff5dea2e41f75b3f81d0777c721dd2bb86b257a Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Wed, 18 Nov 2020 09:31:55 -0600 Subject: aaaaaaaaaaaaaaaaaaaa --- P3/.vscode/launch.json | 2 +- P3/server.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/P3/.vscode/launch.json b/P3/.vscode/launch.json index 7efdc59..9890b76 100644 --- a/P3/.vscode/launch.json +++ b/P3/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/web_server", - "args": ["9000", "testing", "10", "10", "0", "26", "0"], + "args": ["9000", "testing", "10", "1", "0", "99", "0"], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/P3/server.c b/P3/server.c index 8838293..b13d7fc 100644 --- a/P3/server.c +++ b/P3/server.c @@ -188,6 +188,7 @@ void * dispatch(void *arg) { } tempNode->fd = newReq; tempNode->request = dispatchBuf; + tempNode->next = NULL; Q = tempNode; pthread_mutex_unlock(&Qlock); break; @@ -214,7 +215,6 @@ void * worker(void *arg) { pthread_mutex_unlock(&Qlock); continue; } - //Make copy of request and get rid of old one. request_t *request = NULL; request = (request_t*) malloc(sizeof(request_t)); @@ -336,10 +336,13 @@ int main(int argc, char **argv) { pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); // Start the server init(port); + char threadName[16]; // Create dispatcher threads (make detachable????) pthread_t dThreads[dispatchers]; for (int i=0; i