Added timeouts and checked for POLLRDHUP events

This commit is contained in:
Nate Choe
2022-01-29 16:37:54 -06:00
parent c46ed581c3
commit ab2e28ed10
11 changed files with 47 additions and 16 deletions

View File

@@ -175,6 +175,7 @@ Sitefile *parseSitefile(char *path) {
ret->type = TCP;
ret->key = NULL;
ret->cert = NULL;
ret->timeout = 0;
int allocatedLength = 50;
ret->size = 0;
ret->content = malloc(allocatedLength * sizeof(SiteCommand));
@@ -237,6 +238,8 @@ setValue:
ret->key = copyString(argv[2]);
else if (strcmp(argv[1], "cert") == 0)
ret->cert = copyString(argv[2]);
else if (strcmp(argv[1], "timeout") == 0)
ret->timeout = atoi(argv[2]);
else
goto error;
continue;