mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
cleanup
This commit is contained in:
parent
87887b7291
commit
bfa25bac4a
|
@ -1538,7 +1538,7 @@ void net_init_mmsgs(MMSGS* m)
|
||||||
m->msgs[i].msg_hdr.msg_iov = &(m->iovecs[i]);
|
m->msgs[i].msg_hdr.msg_iov = &(m->iovecs[i]);
|
||||||
m->msgs[i].msg_hdr.msg_iovlen = 1;
|
m->msgs[i].msg_hdr.msg_iovlen = 1;
|
||||||
m->msgs[i].msg_hdr.msg_name = &(m->sockaddrs[i]);
|
m->msgs[i].msg_hdr.msg_name = &(m->sockaddrs[i]);
|
||||||
m->msgs[i].msg_hdr.msg_namelen = sizeof(struct sockaddr);
|
m->msgs[i].msg_hdr.msg_namelen = sizeof(m->sockaddrs[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1570,7 +1570,7 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
|
||||||
|
|
||||||
if(m->pos < m->size)
|
if(m->pos < m->size)
|
||||||
{
|
{
|
||||||
sockaddr_to_netaddr(&(m->sockaddrs[m->pos]), addr);
|
sockaddr_to_netaddr((struct sockaddr *)&(m->sockaddrs[m->pos]), addr);
|
||||||
// TODO: network_stats
|
// TODO: network_stats
|
||||||
//network_stats.recv_bytes += bytes;
|
//network_stats.recv_bytes += bytes;
|
||||||
//network_stats.recv_packets++;
|
//network_stats.recv_packets++;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#ifdef CONF_PLATFORM_LINUX
|
#ifdef CONF_PLATFORM_LINUX
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -765,8 +766,8 @@ typedef struct
|
||||||
int size;
|
int size;
|
||||||
struct mmsghdr msgs[VLEN];
|
struct mmsghdr msgs[VLEN];
|
||||||
struct iovec iovecs[VLEN];
|
struct iovec iovecs[VLEN];
|
||||||
char bufs[VLEN][PACKETSIZE+1];
|
char bufs[VLEN][PACKETSIZE];
|
||||||
struct sockaddr sockaddrs[VLEN];
|
struct sockaddr_in sockaddrs[VLEN];
|
||||||
#else
|
#else
|
||||||
int dummy;
|
int dummy;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue