Added error checking with sending responses

This commit is contained in:
Nate Choe
2022-01-30 21:37:47 -06:00
parent efd1ac1a0c
commit e1a66999b6
7 changed files with 23 additions and 8 deletions

View File

@@ -95,6 +95,7 @@ static int readResponse(Connection *conn, char *path) {
goto error;
lseek(fd, 0, SEEK_SET);
sendHeader(conn, CODE_200, len);
conn->len = len;
return fd;
error:
sendErrorResponse(conn, ERROR_500);