version 1.47, 2000/04/10 15:19:43 |
version 1.48, 2000/04/14 10:09:14 |
|
|
packet_put_int(newch); |
packet_put_int(newch); |
packet_put_int(c->local_window_max); |
packet_put_int(c->local_window_max); |
packet_put_int(c->local_maxpacket); |
packet_put_int(c->local_maxpacket); |
|
/* target host and port */ |
packet_put_string(c->path, strlen(c->path)); |
packet_put_string(c->path, strlen(c->path)); |
packet_put_int(c->host_port); |
packet_put_int(c->host_port); |
|
/* originator host and port */ |
packet_put_cstring(remote_hostname); |
packet_put_cstring(remote_hostname); |
packet_put_int(remote_port); |
packet_put_int(remote_port); |
packet_send(); |
packet_send(); |
|
|
|
|
/* Get the data. */ |
/* Get the data. */ |
data = packet_get_string(&data_len); |
data = packet_get_string(&data_len); |
|
packet_done(); |
|
|
if (compat20){ |
if (compat20){ |
if (data_len > c->local_maxpacket) { |
if (data_len > c->local_maxpacket) { |
|
|
return; |
return; |
} |
} |
data = packet_get_string(&data_len); |
data = packet_get_string(&data_len); |
|
packet_done(); |
if (data_len > c->local_window) { |
if (data_len > c->local_window) { |
log("channel %d: rcvd too much extended_data %d, win %d", |
log("channel %d: rcvd too much extended_data %d, win %d", |
c->self, data_len, c->local_window); |
c->self, data_len, c->local_window); |
|
|
int id = packet_get_int(); |
int id = packet_get_int(); |
Channel *c = channel_lookup(id); |
Channel *c = channel_lookup(id); |
|
|
|
packet_done(); |
if (c == NULL) |
if (c == NULL) |
packet_disconnect("Received close confirmation for " |
packet_disconnect("Received close confirmation for " |
"out-of-range channel %d.", id); |
"out-of-range channel %d.", id); |
|
|
if (compat20) { |
if (compat20) { |
c->remote_window = packet_get_int(); |
c->remote_window = packet_get_int(); |
c->remote_maxpacket = packet_get_int(); |
c->remote_maxpacket = packet_get_int(); |
|
packet_done(); |
if (c->cb_fn != NULL && c->cb_event == type) { |
if (c->cb_fn != NULL && c->cb_event == type) { |
debug("callback start"); |
debug("callback start"); |
c->cb_fn(c->self, c->cb_arg); |
c->cb_fn(c->self, c->cb_arg); |
|
|
if (compat20) { |
if (compat20) { |
int reason = packet_get_int(); |
int reason = packet_get_int(); |
char *msg = packet_get_string(NULL); |
char *msg = packet_get_string(NULL); |
|
char *lang = packet_get_string(NULL); |
log("channel_open_failure: %d: reason %d: %s", id, reason, msg); |
log("channel_open_failure: %d: reason %d: %s", id, reason, msg); |
|
packet_done(); |
xfree(msg); |
xfree(msg); |
|
xfree(lang); |
} |
} |
/* Free the channel. This will also close the socket. */ |
/* Free the channel. This will also close the socket. */ |
channel_free(id); |
channel_free(id); |
|
|
return; |
return; |
} |
} |
adjust = packet_get_int(); |
adjust = packet_get_int(); |
|
packet_done(); |
debug("channel %d: rcvd adjust %d", id, adjust); |
debug("channel %d: rcvd adjust %d", id, adjust); |
c->remote_window += adjust; |
c->remote_window += adjust; |
} |
} |