1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-10 03:28:24 +08:00

sendall返回值修正

This commit is contained in:
fumiama
2021-05-05 20:57:18 +08:00
parent 975095b174
commit da2e121ab5

View File

@@ -127,10 +127,10 @@ int send_all(char* file_path, THREADTIMER *timer) {
headers.iov_len = sizeof(uint32_t);
hdtr.headers = &headers;
hdtr.hdr_cnt = 1;
sendfile(fileno(fp), timer->accept_fd, 0, &len, &hdtr, 0);
re = !sendfile(fileno(fp), timer->accept_fd, 0, &len, &hdtr, 0);
#else
send(timer->accept_fd, &file_size, sizeof(uint32_t), 0);
sendfile(timer->accept_fd, fileno(fp), &len, file_size);
re = !sendfile(timer->accept_fd, fileno(fp), &len, file_size);
#endif
printf("Send %lld bytes.\n", len);
close_file(fp);