diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-09-23 12:16:52 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-09-23 12:16:52 -0700 |
commit | dfd78c722b738e8db4c096393b6ecf0e26435f40 (patch) | |
tree | a2d38654b84ead032388820b2d9fc9810d7c5cf6 /sesman | |
parent | db71bc5d8b7841dee476bee228eadf009cec710f (diff) | |
download | xrdp-proprietary-dfd78c722b738e8db4c096393b6ecf0e26435f40.tar.gz xrdp-proprietary-dfd78c722b738e8db4c096393b6ecf0e26435f40.zip |
chansrv: fix for deadlock
Diffstat (limited to 'sesman')
-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 c3d1aa79..56626c77 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -293,10 +293,20 @@ send_data_from_chan_item(struct chan_item *chan_item) out_uint32_le(s, cod->s->size); out_uint8a(s, cod->s->p, size); s_mark_end(s); - LOGM((LOG_LEVEL_DEBUG, "chansrv::send_channel_data: -- " + LOGM((LOG_LEVEL_DEBUG, "chansrv::send_data_from_chan_item: -- " "size %d chan_flags 0x%8.8x", size, chan_flags)); g_sent = 1; - error = trans_force_write(g_con_trans); + if (g_con_trans->in_write) + { + g_writeln("chansrv::send_data_from_chan_item: error, " + "write while in_write"); + error = 1; + } + else + { + /* write but check for read if blocked */ + error = trans_write_check(g_con_trans, -1); + } if (error != 0) { |