Skip to content

Conversation

@smbren
Copy link

@smbren smbren commented Mar 11, 2019

C-Web-Server - Scott Bren

@Tulf

src/server.c Outdated
if(strcmp(endpoint, "/d20") == 0) {
get_d20(fd);
} else {
get_file(fd, cache, endpoint);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep you're getting the file at the right endpoint everything looks good

src/server.c Outdated
resp_404(fd);
} else {
send_response(fd, "HTTP/1.1 200 OK", mime_type, filedata->data, filedata->size);
file_free(filedata);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it's an annoying pattern but whatever you allocate you must free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants