summaryrefslogtreecommitdiff
path: root/Year_3/TSDWL
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-10-22 23:07:21 +0200
committerSanto Cariotti <santo@dcariotti.me>2021-10-22 23:07:21 +0200
commit9b660a40642e71a650fa6cff7409521a2b13275a (patch)
treeee996a959f6051a8a402e092269b998e7527dcb3 /Year_3/TSDWL
parent8e60acc147462386b0ad31b03e4a694efabd834f (diff)
add connection field to response
Diffstat (limited to 'Year_3/TSDWL')
-rw-r--r--Year_3/TSDWL/webserver/server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Year_3/TSDWL/webserver/server.c b/Year_3/TSDWL/webserver/server.c
index ff9a5bf..15c8117 100644
--- a/Year_3/TSDWL/webserver/server.c
+++ b/Year_3/TSDWL/webserver/server.c
@@ -278,7 +278,10 @@ read_file(char* root, request_t* request, int client)
sprintf(buffer, "Content-Length: %ld\n", sb.st_size);
write(client, buffer, strlen(buffer));
- sprintf(buffer, "Last-Modified: %s\n", ctime(&sb.st_mtime));
+ sprintf(buffer, "Last-Modified: %s", ctime(&sb.st_mtime));
+ write(client, buffer, strlen(buffer));
+
+ sprintf(buffer, "Connection: close\n\n");
write(client, buffer, strlen(buffer));
}