mirror of
https://github.com/fumiama/simple-kanban.git
synced 2026-07-02 09:00:27 +08:00
适配非苹果sendfile
This commit is contained in:
4
client.c
4
client.c
@@ -9,8 +9,11 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#if !__APPLE__
|
#if !__APPLE__
|
||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
|
#else
|
||||||
|
struct sf_hdtr hdtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int sockfd;
|
int sockfd;
|
||||||
@@ -18,7 +21,6 @@ char buf[BUFSIZ];
|
|||||||
char bufr[BUFSIZ];
|
char bufr[BUFSIZ];
|
||||||
struct sockaddr_in their_addr;
|
struct sockaddr_in their_addr;
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
struct sf_hdtr hdtr;
|
|
||||||
uint32_t file_size;
|
uint32_t file_size;
|
||||||
int recv_bin = 0;
|
int recv_bin = 0;
|
||||||
|
|
||||||
|
|||||||
4
server.c
4
server.c
@@ -13,8 +13,11 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if !__APPLE__
|
#if !__APPLE__
|
||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
|
#else
|
||||||
|
struct sf_hdtr hdtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PASSWORD "fumiama"
|
#define PASSWORD "fumiama"
|
||||||
@@ -24,7 +27,6 @@
|
|||||||
int fd;
|
int fd;
|
||||||
socklen_t struct_len = sizeof(struct sockaddr_in);
|
socklen_t struct_len = sizeof(struct sockaddr_in);
|
||||||
struct sockaddr_in server_addr;
|
struct sockaddr_in server_addr;
|
||||||
struct sf_hdtr hdtr;
|
|
||||||
|
|
||||||
char *data_path;
|
char *data_path;
|
||||||
char *kanban_path;
|
char *kanban_path;
|
||||||
|
|||||||
Reference in New Issue
Block a user