mirror of
https://github.com/hufrea/byedpi.git
synced 2025-07-02 03:23:04 +00:00
Don't enable fake support for NetBSD
This commit is contained in:
parent
0cb8abc889
commit
07ebe38bf6
20
desync.c
20
desync.c
@ -203,26 +203,6 @@ ssize_t send_fake(int sfd, char *buffer,
|
|||||||
uniperror("sendfile");
|
uniperror("sendfile");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
// https://mail-index.netbsd.org/tech-kern/2008/11/25/msg003672.html
|
|
||||||
#warning "no sendfile"
|
|
||||||
#ifdef __linux__
|
|
||||||
#define MAP_FILE 0
|
|
||||||
#endif
|
|
||||||
void *p2 = mmap(NULL, pos, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, ffd, 0);
|
|
||||||
if (p2 == MAP_FAILED) {
|
|
||||||
uniperror("mmap ffd");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
len = send(sfd, p2, pos, 0);
|
|
||||||
if (len < 0) {
|
|
||||||
uniperror("send sfd");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (munmap(p2, pos) == -1) {
|
|
||||||
uniperror("munmap");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
wait_send(sfd);
|
wait_send(sfd);
|
||||||
memcpy(p, buffer, pos);
|
memcpy(p, buffer, pos);
|
||||||
|
2
params.h
2
params.h
@ -15,7 +15,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) || defined(__NetBSD__) || defined(_WIN32)
|
#if defined(__linux__) || defined(_WIN32)
|
||||||
#define FAKE_SUPPORT 1
|
#define FAKE_SUPPORT 1
|
||||||
#define TIMEOUT_SUPPORT 1
|
#define TIMEOUT_SUPPORT 1
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user