stuff
This commit is contained in:
parent
c944c6ed63
commit
bcc7058591
|
@ -116,10 +116,15 @@ int main() {
|
|||
send_response(client_sock_fd, NOT_FOUND_HEAD, "text/html", NULL, 0);
|
||||
}
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
unsigned long file_size = ftell(file);
|
||||
fseek(file, 0, SEEK_SET);
|
||||
|
||||
printf("Size of File: %ld\n", file_size);
|
||||
|
||||
// int body_size = snprintf(body, 100, "%s\r\n", "hello what up bruh");
|
||||
send_response(client_sock_fd, OK_HEAD, "text/html", body, (body_size + 1));
|
||||
send_response(client_sock_fd, OK_HEAD, "text/html", file, file_size);
|
||||
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
close(client_sock_fd);
|
||||
|
|
Loading…
Reference in New Issue