diff options
| author | ilsimo <ilsimo> | 2008-09-11 20:23:15 +0000 |
|---|---|---|
| committer | ilsimo <ilsimo> | 2008-09-11 20:23:15 +0000 |
| commit | 7c7929861246310d48789748cc150c9a4a492e09 (patch) | |
| tree | 6b71e5c47fdc95451df2c7d23437ca4adfd227f6 /sesman/libscp/libscp_v1s.c | |
| parent | 1e33ad14c3c2e82b9ba74a5f8d1210b5ae643054 (diff) | |
| download | xrdp-proprietary-7c7929861246310d48789748cc150c9a4a492e09.tar.gz xrdp-proprietary-7c7929861246310d48789748cc150c9a4a492e09.zip | |
added first management code
added a rough management tool
fixes in session.c
Diffstat (limited to 'sesman/libscp/libscp_v1s.c')
| -rw-r--r-- | sesman/libscp/libscp_v1s.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sesman/libscp/libscp_v1s.c b/sesman/libscp/libscp_v1s.c index 74ce187d..93c42fa8 100644 --- a/sesman/libscp/libscp_v1s.c +++ b/sesman/libscp/libscp_v1s.c @@ -87,7 +87,8 @@ enum SCP_SERVER_STATES_E scp_v1s_accept(struct SCP_CONNECTION* c, struct SCP_SES if (cmdset == SCP_COMMAND_SET_MANAGE) { log_message(s_log, LOG_LEVEL_DEBUG, "[v1s:%d] requested management connection", __LINE__); - return SCP_SERVER_STATE_START_MANAGE; + /* should return SCP_SERVER_STATE_START_MANAGE */ + return scp_v1s_mng_accept(c, s); } /* if we started with resource sharing... */ @@ -372,7 +373,23 @@ scp_v1s_connect_new_session(struct SCP_CONNECTION* c, SCP_DISPLAY d) enum SCP_SERVER_STATES_E scp_v1s_connection_error(struct SCP_CONNECTION* c, char* error) { - return SCP_SERVER_STATE_INTERNAL_ERR; + tui16 len; + + len = g_strlen(error); + init_stream(c->out_s,c->out_s->size); + + out_uint32_be(c->out_s, 1); + /* packet size: 4 + 4 + 2 + 2 + len */ + /* version + size + cmdset + cmd */ + out_uint32_be(c->out_s, (12 + len)); + out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT); + out_uint16_be(c->out_s, SCP_CMD_CONN_ERROR); + + if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, (12 + len))) + { + return SCP_SERVER_STATE_NETWORK_ERR; + } + return SCP_SERVER_STATE_END; } |
