mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 06:15:14 +00:00
Style
This commit is contained in:
parent
bd2eb4e4e1
commit
7700791053
5
desync.c
5
desync.c
@ -174,13 +174,11 @@ ssize_t send_fake(int sfd, char *buffer,
|
||||
else pkt.size = 0;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
int ffd = memfd_create("name", 0);
|
||||
if (ffd < 0) {
|
||||
uniperror("memfd_create");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
char *p = 0;
|
||||
ssize_t len = -1;
|
||||
|
||||
@ -221,13 +219,12 @@ ssize_t send_fake(int sfd, char *buffer,
|
||||
uniperror("setsockopt IP_OPTIONS");
|
||||
break;
|
||||
}
|
||||
#ifdef __linux__
|
||||
|
||||
len = sendfile(sfd, ffd, 0, pos);
|
||||
if (len < 0) {
|
||||
uniperror("sendfile");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
wait_send(sfd);
|
||||
memcpy(p, buffer, pos);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user