mirror of
https://github.com/fumiama/simple-kanban.git
synced 2026-06-05 00:10:29 +08:00
适配非苹果sendfile
This commit is contained in:
6
client.c
6
client.c
@@ -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;
|
||||
|
||||
|
||||
6
server.c
6
server.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user