1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

Add session/channel byte/packet counters

Signed-off-by: Audrius Butkevicius <audrius.butkevicius@elastichosts.com>
This commit is contained in:
Audrius Butkevicius
2014-02-12 16:53:18 +00:00
committed by Aris Adamantiadis
parent 370d4b014d
commit a277dd9277
8 changed files with 106 additions and 0 deletions

View File

@@ -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? */