diff options
author | speidy <speidy@gmail.com> | 2014-03-02 01:39:34 +0200 |
---|---|---|
committer | speidy <speidy@gmail.com> | 2014-03-02 01:39:34 +0200 |
commit | 1f1e803140ea96b81ac4700a6759a9617d0f2fd2 (patch) | |
tree | e9d2761170ec2461f178a595482507700879deee /libxrdp/xrdp_mcs.c | |
parent | 80204e2536327f46610d5925c552aff235e9f447 (diff) | |
parent | 0b18909f269ee582ec22bb808839c4434a0da3e7 (diff) | |
download | xrdp-proprietary-1f1e803140ea96b81ac4700a6759a9617d0f2fd2.tar.gz xrdp-proprietary-1f1e803140ea96b81ac4700a6759a9617d0f2fd2.zip |
Merge ../../neutrinolabs/xrdp into fastpath
Conflicts:
libxrdp/libxrdp.c
libxrdp/libxrdp.h
libxrdp/xrdp_iso.c
libxrdp/xrdp_sec.c
libxrdp/xrdp_tcp.c
xrdp/xrdp.ini
Diffstat (limited to 'libxrdp/xrdp_mcs.c')
-rw-r--r-- | libxrdp/xrdp_mcs.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c index 2c643373..526587d5 100644 --- a/libxrdp/xrdp_mcs.c +++ b/libxrdp/xrdp_mcs.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,8 +75,8 @@ xrdp_mcs_delete(struct xrdp_mcs *self) } /*****************************************************************************/ -/* This function sends channel join confirm*/ -/* returns error = 1 ok = 0*/ +/* This function sends channel join confirm */ +/* returns error = 1 ok = 0 */ static int APP_CC xrdp_mcs_send_cjcf(struct xrdp_mcs *self, int userid, int chanid) { @@ -160,6 +160,12 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) /* this is channels getting added from the client */ if (appid == MCS_CJRQ) { + if (s == self->iso_layer->trans->in_s) + { + /* this should not happen */ + g_writeln("xrdp_mcs_recv: error, MCS_CJRQ at wrong time"); + return 1; + } if (!s_check_rem(s, 4)) { return 1; @@ -174,13 +180,12 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) { log_message(LOG_LEVEL_ERROR,"Non handled error from xrdp_mcs_send_cjcf") ; } - continue; } if (appid == MCS_SDRQ || appid == MCS_SDIN) { - break ; + break; } else { @@ -955,16 +960,17 @@ xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan) * Internal help function to close the socket * @param self */ -void close_rdp_socket(struct xrdp_mcs *self) +void APP_CC +close_rdp_socket(struct xrdp_mcs *self) { - if(self->iso_layer->tcp_layer) + if (self->iso_layer != 0) { - if(self->iso_layer->tcp_layer->trans) + if (self->iso_layer->trans != 0) { - g_tcp_close(self->iso_layer->tcp_layer->trans->sck); - self->iso_layer->tcp_layer->trans->sck = 0 ; + g_tcp_close(self->iso_layer->trans->sck); + self->iso_layer->trans->sck = 0 ; g_writeln("xrdp_mcs_disconnect - socket closed"); - return ; + return; } } g_writeln("Failed to close socket"); |