summaryrefslogtreecommitdiffstats
path: root/tinyNET
diff options
context:
space:
mode:
authorSystem Administrator <root@Mamadous-MacBook-Pro.local>2016-02-25 00:54:48 +0100
committerSystem Administrator <root@Mamadous-MacBook-Pro.local>2016-02-25 00:54:48 +0100
commit3d46d2f68c23e39f6862d71854d5ebed495836b4 (patch)
treeb6df1fe108905a90bc5dd013a4815f0c17dbcb68 /tinyNET
parent40a8a15df631bbfd55736ba1f521f95fdc4a7e8d (diff)
downloaddoubango-3d46d2f68c23e39f6862d71854d5ebed495836b4.zip
doubango-3d46d2f68c23e39f6862d71854d5ebed495836b4.tar.gz
Update cfscket transport to report correct in/out bytes
Diffstat (limited to 'tinyNET')
-rwxr-xr-xtinyNET/src/tnet_transport_cfsocket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tinyNET/src/tnet_transport_cfsocket.c b/tinyNET/src/tnet_transport_cfsocket.c
index ed844b6..5ffe88d 100755
--- a/tinyNET/src/tnet_transport_cfsocket.c
+++ b/tinyNET/src/tnet_transport_cfsocket.c
@@ -319,6 +319,7 @@ static int recvData(tnet_transport_t *transport, transport_socket_xt* active_soc
if (len && buffer) {
tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, active_socket->fd);
+ transport->bytes_in += len;
if (e && buffer && len) {
e->data = buffer;
buffer = NULL;
@@ -485,6 +486,7 @@ tsk_size_t tnet_transport_send(const tnet_transport_handle_t *handle, tnet_fd_t
}
bail:
+ transport->bytes_out += numberOfBytesSent;
return numberOfBytesSent;
}
@@ -517,6 +519,7 @@ tsk_size_t tnet_transport_sendto(const tnet_transport_handle_t *handle, tnet_fd_
}
bail:
+ transport->bytes_out += numberOfBytesSent;
return numberOfBytesSent;
}
@@ -1034,6 +1037,7 @@ void __CFSocketCallBack(CFSocketRef s, CFSocketCallBackType callbackType, CFData
int len = (int)CFDataGetLength((CFDataRef)data);
if (ptr && len > 0) {
tnet_transport_event_t* e = tnet_transport_event_create(event_data, transport->callback_data, sock->fd);
+ transport->bytes_in += len;
if (e) {
e->data = tsk_malloc(len);
if (e->data) {
OpenPOWER on IntegriCloud