summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/channels.c b/channels.c
index 6ff9e2583..1937b0244 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.183 2002/09/17 07:47:02 itojun Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.187 2003/03/05 22:33:43 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -413,13 +413,13 @@ channel_not_very_much_buffered_data(void)
413#if 0 413#if 0
414 if (!compat20 && 414 if (!compat20 &&
415 buffer_len(&c->input) > packet_get_maxsize()) { 415 buffer_len(&c->input) > packet_get_maxsize()) {
416 debug("channel %d: big input buffer %d", 416 debug2("channel %d: big input buffer %d",
417 c->self, buffer_len(&c->input)); 417 c->self, buffer_len(&c->input));
418 return 0; 418 return 0;
419 } 419 }
420#endif 420#endif
421 if (buffer_len(&c->output) > packet_get_maxsize()) { 421 if (buffer_len(&c->output) > packet_get_maxsize()) {
422 debug("channel %d: big output buffer %d > %d", 422 debug2("channel %d: big output buffer %d > %d",
423 c->self, buffer_len(&c->output), 423 c->self, buffer_len(&c->output),
424 packet_get_maxsize()); 424 packet_get_maxsize());
425 return 0; 425 return 0;
@@ -578,7 +578,7 @@ channel_send_open(int id)
578 log("channel_send_open: %d: bad id", id); 578 log("channel_send_open: %d: bad id", id);
579 return; 579 return;
580 } 580 }
581 debug("send channel open %d", id); 581 debug2("channel %d: send open", id);
582 packet_start(SSH2_MSG_CHANNEL_OPEN); 582 packet_start(SSH2_MSG_CHANNEL_OPEN);
583 packet_put_cstring(c->ctype); 583 packet_put_cstring(c->ctype);
584 packet_put_int(c->self); 584 packet_put_int(c->self);
@@ -588,15 +588,15 @@ channel_send_open(int id)
588} 588}
589 589
590void 590void
591channel_request_start(int local_id, char *service, int wantconfirm) 591channel_request_start(int id, char *service, int wantconfirm)
592{ 592{
593 Channel *c = channel_lookup(local_id); 593 Channel *c = channel_lookup(id);
594 594
595 if (c == NULL) { 595 if (c == NULL) {
596 log("channel_request_start: %d: unknown channel id", local_id); 596 log("channel_request_start: %d: unknown channel id", id);
597 return; 597 return;
598 } 598 }
599 debug("channel request %d: %s", local_id, service) ; 599 debug("channel %d: request %s", id, service) ;
600 packet_start(SSH2_MSG_CHANNEL_REQUEST); 600 packet_start(SSH2_MSG_CHANNEL_REQUEST);
601 packet_put_int(c->remote_id); 601 packet_put_int(c->remote_id);
602 packet_put_cstring(service); 602 packet_put_cstring(service);
@@ -1997,6 +1997,7 @@ channel_input_port_open(int type, u_int32_t seq, void *ctxt)
1997 c->remote_id = remote_id; 1997 c->remote_id = remote_id;
1998 } 1998 }
1999 if (c == NULL) { 1999 if (c == NULL) {
2000 xfree(originator_string);
2000 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE); 2001 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
2001 packet_put_int(remote_id); 2002 packet_put_int(remote_id);
2002 packet_send(); 2003 packet_send();
@@ -2281,7 +2282,10 @@ connect_to(const char *host, u_short port)
2281 } 2282 }
2282 sock = socket(ai->ai_family, SOCK_STREAM, 0); 2283 sock = socket(ai->ai_family, SOCK_STREAM, 0);
2283 if (sock < 0) { 2284 if (sock < 0) {
2284 error("socket: %.100s", strerror(errno)); 2285 if (ai->ai_next == NULL)
2286 error("socket: %.100s", strerror(errno));
2287 else
2288 verbose("socket: %.100s", strerror(errno));
2285 continue; 2289 continue;
2286 } 2290 }
2287 if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) 2291 if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0)
@@ -2606,6 +2610,7 @@ x11_input_open(int type, u_int32_t seq, void *ctxt)
2606 /* Send refusal to the remote host. */ 2610 /* Send refusal to the remote host. */
2607 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE); 2611 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
2608 packet_put_int(remote_id); 2612 packet_put_int(remote_id);
2613 xfree(remote_host);
2609 } else { 2614 } else {
2610 /* Send a confirmation to the remote host. */ 2615 /* Send a confirmation to the remote host. */
2611 packet_start(SSH_MSG_CHANNEL_OPEN_CONFIRMATION); 2616 packet_start(SSH_MSG_CHANNEL_OPEN_CONFIRMATION);