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