diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-10-02 12:52:35 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-10-02 12:52:35 -0700 |
commit | 7176f1464710fd809af92ae3c2fcf9412eda9ace (patch) | |
tree | 10c6a89f04fbf6a29c5e64530a12a74e960fcd37 /xrdp/xrdp_listen.c | |
parent | 97473e4f66e30ba75f0069a01f392760b6a17075 (diff) | |
download | xrdp-proprietary-7176f1464710fd809af92ae3c2fcf9412eda9ace.tar.gz xrdp-proprietary-7176f1464710fd809af92ae3c2fcf9412eda9ace.zip |
added options to set tcp send and recv buffer sizes
Diffstat (limited to 'xrdp/xrdp_listen.c')
-rw-r--r-- | xrdp/xrdp_listen.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c index 2e1617a6..5d7edf83 100644 --- a/xrdp/xrdp_listen.c +++ b/xrdp/xrdp_listen.c @@ -217,6 +217,18 @@ xrdp_listen_get_port_address(char *port, int port_bytes, val = (char *)list_get_item(values, index); *tcp_keepalive = g_text2bool(val); } + + if (g_strcasecmp(val, "tcp_send_buffer_bytes") == 0) + { + val = (char *)list_get_item(values, index); + startup_param->send_buffer_bytes = g_atoi(val); + } + + if (g_strcasecmp(val, "tcp_recv_buffer_bytes") == 0) + { + val = (char *)list_get_item(values, index); + startup_param->recv_buffer_bytes = g_atoi(val); + } } } } @@ -322,6 +334,7 @@ xrdp_listen_main_loop(struct xrdp_listen *self) tbus done_obj; int tcp_nodelay; int tcp_keepalive; + int bytes; self->status = 1; @@ -356,6 +369,54 @@ xrdp_listen_main_loop(struct xrdp_listen *self) } } + if (self->startup_params->send_buffer_bytes > 0) + { + bytes = self->startup_params->send_buffer_bytes; + log_message(LOG_LEVEL_INFO, "setting send buffer to %d bytes", + bytes); + if (g_sck_set_send_buffer_bytes(self->listen_trans->sck, + bytes) != 0) + { + log_message(LOG_LEVEL_ERROR, "error setting send buffer"); + } + else + { + if (g_sck_get_send_buffer_bytes(self->listen_trans->sck, + &bytes) != 0) + { + log_message(LOG_LEVEL_ERROR, "error getting send buffer"); + } + else + { + log_message(LOG_LEVEL_INFO, "send buffer set to %d bytes", bytes); + } + } + } + + if (self->startup_params->recv_buffer_bytes > 0) + { + bytes = self->startup_params->recv_buffer_bytes; + log_message(LOG_LEVEL_INFO, "setting recv buffer to %d bytes", + bytes); + if (g_sck_set_recv_buffer_bytes(self->listen_trans->sck, + bytes) != 0) + { + log_message(LOG_LEVEL_ERROR, "error setting recv buffer"); + } + else + { + if (g_sck_get_recv_buffer_bytes(self->listen_trans->sck, + &bytes) != 0) + { + log_message(LOG_LEVEL_ERROR, "error getting recv buffer"); + } + else + { + log_message(LOG_LEVEL_INFO, "recv buffer set to %d bytes", bytes); + } + } + } + self->listen_trans->trans_conn_in = xrdp_listen_conn_in; self->listen_trans->callback_data = self; term_obj = g_get_term_event(); /*Global termination event */ |