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

适配非苹果sendfile

This commit is contained in:
fumiama
2021-05-02 23:32:51 +08:00
parent 02314a6399
commit 5eb31d33c7
2 changed files with 8 additions and 4 deletions

View File

@@ -9,8 +9,11 @@
#include <arpa/inet.h>
#include <sys/stat.h>
#include <pthread.h>
#if !__APPLE__
#include <sys/sendfile.h>
#include <sys/sendfile.h>
#else
struct sf_hdtr hdtr;
#endif
int sockfd;
@@ -18,7 +21,6 @@ char buf[BUFSIZ];
char bufr[BUFSIZ];
struct sockaddr_in their_addr;
pthread_t thread;
struct sf_hdtr hdtr;
uint32_t file_size;
int recv_bin = 0;

View File

@@ -13,8 +13,11 @@
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#if !__APPLE__
#include <sys/sendfile.h>
#include <sys/sendfile.h>
#else
struct sf_hdtr hdtr;
#endif
#define PASSWORD "fumiama"
@@ -24,7 +27,6 @@
int fd;
socklen_t struct_len = sizeof(struct sockaddr_in);
struct sockaddr_in server_addr;
struct sf_hdtr hdtr;
char *data_path;
char *kanban_path;