diff options
| author | Audrius Butkevicius <audrius.butkevicius@elastichosts.com> | 2014-02-12 16:53:18 +0000 |
|---|---|---|
| committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2014-02-12 18:21:16 +0100 |
| commit | a277dd92776c5c18d4e08a555e169c46cf75ff94 (patch) | |
| tree | 5873ed8615e8b0d52ac83337cd4b14d528276d34 /src/socket.c | |
| parent | 370d4b014d22d6ae9229498f75a4f6d28d0d1614 (diff) | |
| download | libssh-a277dd92776c5c18d4e08a555e169c46cf75ff94.tar.gz libssh-a277dd92776c5c18d4e08a555e169c46cf75ff94.tar.xz libssh-a277dd92776c5c18d4e08a555e169c46cf75ff94.zip | |
Add session/channel byte/packet counters
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@elastichosts.com>
Diffstat (limited to 'src/socket.c')
| -rw-r--r-- | src/socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c index 8f4c9b22..ab47b96a 100644 --- a/src/socket.c +++ b/src/socket.c @@ -280,6 +280,9 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd, int r } } if(r>0){ + if (s->session->socket_counter != NULL) { + s->session->socket_counter->in_bytes += r; + } /* Bufferize the data and then call the callback */ r = ssh_buffer_add_data(s->in_buffer,buffer,r); if (r < 0) { @@ -659,6 +662,9 @@ int ssh_socket_nonblocking_flush(ssh_socket s) { return SSH_ERROR; } buffer_pass_bytes(s->out_buffer, w); + if (s->session->socket_counter != NULL) { + s->session->socket_counter->out_bytes += w; + } } /* Is there some data pending? */ |
