mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
packet: Improve logging output
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
f8be4d1b3b
commit
8e42d3959c
@@ -367,6 +367,8 @@ static void ssh_packet_socket_controlflow_callback(int code, void *userdata)
|
||||
ssh_channel channel;
|
||||
|
||||
if (code == SSH_SOCKET_FLOW_WRITEWONTBLOCK) {
|
||||
SSH_LOG(SSH_LOG_TRACE, "sending channel_write_wontblock callback");
|
||||
|
||||
/* the out pipe is empty so we can forward this to channels */
|
||||
it = ssh_list_get_iterator(session->channels);
|
||||
while (it != NULL) {
|
||||
|
||||
@@ -227,6 +227,11 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd,
|
||||
if (!ssh_socket_is_open(s)) {
|
||||
return -1;
|
||||
}
|
||||
SSH_LOG(SSH_LOG_TRACE, "Poll callback on socket %d (%s%s%s), out buffer %d",fd,
|
||||
(revents & POLLIN) ? "POLLIN ":"",
|
||||
(revents & POLLOUT) ? "POLLOUT ":"",
|
||||
(revents & POLLERR) ? "POLLERR":"",
|
||||
ssh_buffer_get_len(s->out_buffer));
|
||||
if (revents & POLLERR || revents & POLLHUP) {
|
||||
/* Check if we are in a connecting state */
|
||||
if (s->state == SSH_SOCKET_CONNECTING) {
|
||||
@@ -334,6 +339,7 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd,
|
||||
ssh_socket_nonblocking_flush(s);
|
||||
} else if (s->callbacks && s->callbacks->controlflow) {
|
||||
/* Otherwise advertise the upper level that write can be done */
|
||||
SSH_LOG(SSH_LOG_TRACE,"sending control flow event");
|
||||
s->callbacks->controlflow(SSH_SOCKET_FLOW_WRITEWONTBLOCK,
|
||||
s->callbacks->userdata);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user