1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-08 10:00:24 +08:00
This commit is contained in:
fumiama
2021-05-05 22:47:02 +08:00
parent 1db5dd405f
commit 4f0eb77b23

View File

@@ -130,15 +130,16 @@ int send_all(char* file_path, THREADTIMER *timer) {
hdtr.trailers = NULL;
hdtr.trl_cnt = 0;
re = !sendfile(fileno(fp), timer->accept_fd, 0, &len, &hdtr, 0);
if(!re) perror("Sendfile");
#else
send(timer->accept_fd, &file_size, sizeof(uint32_t), 0);
re = !sendfile(timer->accept_fd, fileno(fp), &len, file_size);
if(!re) perror("Sendfile");
#endif
printf("Send %lld bytes.\n", len);
close_file(fp);
timer->is_open = 0;
}
if(!re) perror("Sendfile");
return re;
}