Skip to content

Commit

Permalink
Add more comments to server.c
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchen1991 committed Oct 21, 2018
1 parent 816d155 commit 1f26379
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ src/data.txt
*.o
cache_tests/cache_tests
cache_tests/cache_tests.exe
cache_tests/cache_tests.log
cache_tests/cache_tests.log
target/
data.txt
3 changes: 2 additions & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ void resp_404(int fd)
struct file_data *filedata;
char *mime_type;

// Fetch the 404.html file
snprintf(filepath, sizeof filepath, "%s/404.html", SERVER_FILES);
filedata = file_load(filepath);

Expand Down Expand Up @@ -190,7 +191,7 @@ int main(void)
printf("webserver: waiting for connections on port %s...\n", PORT);

// This is the main loop that accepts incoming connections and
// fork()s a handler process to take care of it. The main parent
// forks a handler process to take care of it. The main parent
// process then goes back to waiting for new connections.

while(1) {
Expand Down

0 comments on commit 1f26379

Please sign in to comment.