aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2015-09-07 09:13:04 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2015-12-07 20:32:17 +0100
commit17c2e1bdddb70a81209666862d3655378871ed15 (patch)
tree84a1357c3d88bf2539fb8b26fba49985d126e5dd
parent41d9dd95a4f0d438651c69425ee4ec677b7c47fd (diff)
downloadlibssh-connector.tar.gz
libssh-connector.tar.xz
libssh-connector.zip
packet: Improve logging outputconnector
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/packet.c2
-rw-r--r--src/socket.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/packet.c b/src/packet.c
index f4ed8fac..46b54c75 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -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) {
diff --git a/src/socket.c b/src/socket.c
index 022c9a76..9e928bed 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -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":"",
+ buffer_get_rest_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);
}