Mercurial > dropbear
comparison common-channel.c @ 13:db2c8e6fb284
Fixed stupid agentfwd error (using the listening FD, not the accepted on. gah)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 03 Jun 2004 18:08:34 +0000 |
parents | 7f77962de998 |
children | 0913e2ee3545 |
comparison
equal
deleted
inserted
replaced
12:7a37cff27258 | 13:db2c8e6fb284 |
---|---|
605 len = read(fd, buf_getwriteptr(buf, maxlen), maxlen); | 605 len = read(fd, buf_getwriteptr(buf, maxlen), maxlen); |
606 if (len <= 0) { | 606 if (len <= 0) { |
607 /* on error/eof, send eof */ | 607 /* on error/eof, send eof */ |
608 if (len == 0 || errno != EINTR) { | 608 if (len == 0 || errno != EINTR) { |
609 closeoutfd(channel, fd); | 609 closeoutfd(channel, fd); |
610 TRACE(("leave send_msg_channel_data: read err")); | 610 TRACE(("leave send_msg_channel_data: read err %d", channel->index)); |
611 } | 611 } |
612 buf_free(buf); | 612 buf_free(buf); |
613 return; | 613 return; |
614 } | 614 } |
615 buf_incrlen(buf, len); | 615 buf_incrlen(buf, len); |
887 | 887 |
888 encrypt_packet(); | 888 encrypt_packet(); |
889 TRACE(("leave send_msg_channel_open_confirmation")); | 889 TRACE(("leave send_msg_channel_open_confirmation")); |
890 } | 890 } |
891 | 891 |
892 #ifdef USE_LISTENERS | 892 #ifdef USING_LISTENERS |
893 /* Create a new channel, and start the open request. This is intended | 893 /* Create a new channel, and start the open request. This is intended |
894 * for X11, agent, tcp forwarding, and should be filled with channel-specific | 894 * for X11, agent, tcp forwarding, and should be filled with channel-specific |
895 * options, with the calling function calling encrypt_packet() after | 895 * options, with the calling function calling encrypt_packet() after |
896 * completion. It is mandatory for the caller to encrypt_packet() if | 896 * completion. It is mandatory for the caller to encrypt_packet() if |
897 * DROPBEAR_SUCCESS is returned */ | 897 * DROPBEAR_SUCCESS is returned */ |
944 } | 944 } |
945 | 945 |
946 channel->remotechan = buf_getint(ses.payload); | 946 channel->remotechan = buf_getint(ses.payload); |
947 channel->transwindow = buf_getint(ses.payload); | 947 channel->transwindow = buf_getint(ses.payload); |
948 channel->transmaxpacket = buf_getint(ses.payload); | 948 channel->transmaxpacket = buf_getint(ses.payload); |
949 | 949 |
950 TRACE(("new chan remote %d localho %d", channel->remotechan, chan)); | |
951 | |
952 | |
950 TRACE(("leave recv_msg_channel_open_confirmation")); | 953 TRACE(("leave recv_msg_channel_open_confirmation")); |
951 } | 954 } |
952 | 955 |
953 /* Notification that our channel open request failed */ | 956 /* Notification that our channel open request failed */ |
954 void recv_msg_channel_open_failure() { | 957 void recv_msg_channel_open_failure() { |
1010 if (closein && fd == channel->infd) { | 1013 if (closein && fd == channel->infd) { |
1011 channel->infd = FD_CLOSED; | 1014 channel->infd = FD_CLOSED; |
1012 } | 1015 } |
1013 } | 1016 } |
1014 | 1017 |
1015 #endif /* USE_LISTENERS */ | 1018 #endif /* USING_LISTENERS */ |