diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-08-08 17:20:04 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-08-08 17:20:04 -0700 |
commit | f43e0eb68f78f5f279f1963224f8e7a2b97c4a4e (patch) | |
tree | aeaa0fe30298091737fe384552dc39245f04ad06 /sesman/chansrv/chansrv.c | |
parent | 9fb425922a5bc960d353f7f749222ebc929c4d04 (diff) | |
download | xrdp-proprietary-f43e0eb68f78f5f279f1963224f8e7a2b97c4a4e.tar.gz xrdp-proprietary-f43e0eb68f78f5f279f1963224f8e7a2b97c4a4e.zip |
chansrv: fix for writing to non existing channel goes to first channel
Diffstat (limited to 'sesman/chansrv/chansrv.c')
-rw-r--r-- | sesman/chansrv/chansrv.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index 07ece0d9..365b285c 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -78,6 +78,10 @@ send_channel_data(int chan_id, char* data, int size) int sent; int rv; + if (chan_id == -1) + { + return 1; + } s = trans_get_out_s(g_con_trans, 8192); if (s == 0) { @@ -448,7 +452,10 @@ my_api_trans_data_in(struct trans* trans) { LOG(10, ("my_api_trans_data_in: got data %d", error)); ad = (struct xrdp_api_data*)(trans->callback_data); - send_channel_data(ad->chan_id, s->data, error); + if (send_channel_data(ad->chan_id, s->data, error) != 0) + { + LOG(0, ("my_api_trans_data_in: send_channel_data failed")); + } } else { @@ -540,8 +547,11 @@ my_api_trans_conn_in(struct trans* trans, struct trans* new_trans) break; } } - LOG(10, ("my_api_trans_conn_in: found %d", found)); + if (!found) + { + ad->chan_id = -1; + } new_trans->callback_data = ad; |