mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
cleanup: use ssh_ prefix in the buffer (non-static) functions
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
18
src/socket.c
18
src/socket.c
@@ -290,10 +290,10 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd,
|
||||
}
|
||||
if (s->callbacks && s->callbacks->data) {
|
||||
do {
|
||||
r = s->callbacks->data(buffer_get_rest(s->in_buffer),
|
||||
buffer_get_rest_len(s->in_buffer),
|
||||
r = s->callbacks->data(ssh_buffer_get_rest(s->in_buffer),
|
||||
ssh_buffer_get_rest_len(s->in_buffer),
|
||||
s->callbacks->userdata);
|
||||
buffer_pass_bytes(s->in_buffer, r);
|
||||
ssh_buffer_pass_bytes(s->in_buffer, r);
|
||||
} while ((r > 0) && (s->state == SSH_SOCKET_CONNECTED));
|
||||
/* p may have been freed, so don't use it
|
||||
* anymore in this function */
|
||||
@@ -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 (buffer_get_rest_len(s->out_buffer) > 0) {
|
||||
if (ssh_buffer_get_rest_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 = buffer_get_rest_len(s->out_buffer);
|
||||
len = ssh_buffer_get_rest_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);
|
||||
@@ -658,7 +658,7 @@ int ssh_socket_nonblocking_flush(ssh_socket s) {
|
||||
return SSH_AGAIN;
|
||||
}
|
||||
if (s->write_wontblock && len > 0) {
|
||||
w = ssh_socket_unbuffered_write(s, buffer_get_rest(s->out_buffer), len);
|
||||
w = ssh_socket_unbuffered_write(s, ssh_buffer_get_rest(s->out_buffer), len);
|
||||
if (w < 0) {
|
||||
session->alive = 0;
|
||||
ssh_socket_close(s);
|
||||
@@ -674,14 +674,14 @@ int ssh_socket_nonblocking_flush(ssh_socket s) {
|
||||
}
|
||||
return SSH_ERROR;
|
||||
}
|
||||
buffer_pass_bytes(s->out_buffer, w);
|
||||
ssh_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? */
|
||||
len = buffer_get_rest_len(s->out_buffer);
|
||||
len = ssh_buffer_get_rest_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 buffer_get_rest_len(s->out_buffer);
|
||||
return ssh_buffer_get_rest_len(s->out_buffer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user