summaryrefslogtreecommitdiffstats
path: root/src/socket.c
diff options
context:
space:
mode:
authorFabiano Fidêncio <fidencio@redhat.com>2015-09-25 00:34:42 +0200
committerFabiano Fidêncio <fidencio@redhat.com>2015-10-12 13:56:21 +0200
commitd1de73c7aaa65b2a137ada57b479d5a42e4c212f (patch)
treee1796b2137d3c6553dfbb4bf6af9aef7889f2d9d /src/socket.c
parentc12915e5037fe37fabf17126e57f08e5c4a49971 (diff)
downloadlibssh-d1de73c7aaa65b2a137ada57b479d5a42e4c212f.tar.gz
libssh-d1de73c7aaa65b2a137ada57b479d5a42e4c212f.tar.xz
libssh-d1de73c7aaa65b2a137ada57b479d5a42e4c212f.zip
buffer: do not use ssh_buffer_get_rest_len()
As ssh_buffer_get_len() actually calls ssh_buffer_get_rest_len(), let's just use the first one. This is a preparatory step for removing ssh_buffer_get_rest_len(). Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/socket.c b/src/socket.c
index 06ea9e62..823be861 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -291,7 +291,7 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd,
if (s->callbacks && s->callbacks->data) {
do {
r = s->callbacks->data(ssh_buffer_get(s->in_buffer),
- ssh_buffer_get_rest_len(s->in_buffer),
+ ssh_buffer_get_len(s->in_buffer),
s->callbacks->userdata);
ssh_buffer_pass_bytes(s->in_buffer, r);
} while ((r > 0) && (s->state == SSH_SOCKET_CONNECTED));
@@ -330,7 +330,7 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd,
}
/* If buffered data is pending, write it */
- if (ssh_buffer_get_rest_len(s->out_buffer) > 0) {
+ if (ssh_buffer_get_len(s->out_buffer) > 0) {
ssh_socket_nonblocking_flush(s);
} else if (s->callbacks && s->callbacks->controlflow) {
/* Otherwise advertise the upper level that write can be done */
@@ -650,7 +650,7 @@ int ssh_socket_nonblocking_flush(ssh_socket s) {
return SSH_ERROR;
}
- len = ssh_buffer_get_rest_len(s->out_buffer);
+ len = ssh_buffer_get_len(s->out_buffer);
if (!s->write_wontblock && s->poll_out && len > 0) {
/* force the poll system to catch pollout events */
ssh_poll_add_events(s->poll_out, POLLOUT);
@@ -681,7 +681,7 @@ int ssh_socket_nonblocking_flush(ssh_socket s) {
}
/* Is there some data pending? */
- len = ssh_buffer_get_rest_len(s->out_buffer);
+ len = ssh_buffer_get_len(s->out_buffer);
if (s->poll_out && len > 0) {
/* force the poll system to catch pollout events */
ssh_poll_add_events(s->poll_out, POLLOUT);
@@ -721,7 +721,7 @@ int ssh_socket_data_writable(ssh_socket s) {
int ssh_socket_buffered_write_bytes(ssh_socket s){
if(s==NULL || s->out_buffer == NULL)
return 0;
- return ssh_buffer_get_rest_len(s->out_buffer);
+ return ssh_buffer_get_len(s->out_buffer);
}