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

修复linux sendfile语法

This commit is contained in:
fumiama
2021-05-03 00:10:53 +08:00
parent 3ac2667c42
commit 0a0a449a8f
2 changed files with 3 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ int main(int argc,char *argv[]) { //usage: ./client host port
else puts("Send file error.");
#else
send(sockfd, &file_size, sizeof(uint32_t), 0);
if(!sendfile(sockfd, fileno(fp), &len, file_size)) puts("Send file success.");
if(!sendfile(sockfd, fileno(fp), &len, htonl(file_size))) puts("Send file success.");
else puts("Send file error.");
#endif
fclose(fp);