mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #3488
3488: Implement network statistics for recvmmsg r=heinrich5991 a=def- ![screenshot-20210109@114810](https://user-images.githubusercontent.com/2335377/104089616-9b490200-5270-11eb-8956-26c8c930f3c4.png) ## Checklist - [x] Tested the change ingame - [x] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
fc2a49d15b
|
@ -1629,12 +1629,11 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *buffer, int maxsize, MMSGS
|
|||
if(m->pos < m->size)
|
||||
{
|
||||
sockaddr_to_netaddr((struct sockaddr *)&(m->sockaddrs[m->pos]), addr);
|
||||
// TODO: network_stats
|
||||
//network_stats.recv_bytes += bytes;
|
||||
//network_stats.recv_packets++;
|
||||
bytes = m->msgs[m->pos].msg_len;
|
||||
*data = (unsigned char *)m->bufs[m->pos];
|
||||
m->pos++;
|
||||
network_stats.recv_bytes += bytes;
|
||||
network_stats.recv_packets++;
|
||||
return bytes;
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue