summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorIdan Freiberg <speidy@gmail.com>2014-07-15 18:29:40 +0300
committerIdan Freiberg <speidy@gmail.com>2014-07-15 18:29:40 +0300
commitf0b6c6b1d178419ae82ad1c8ea2d74c97cc2f27b (patch)
tree4507c5940fa37c55c717dca7244faea0ed1507a5 /common
parent5fcf6beffa3367b8b313bf4414ffd6b3419c76d1 (diff)
downloadxrdp-proprietary-f0b6c6b1d178419ae82ad1c8ea2d74c97cc2f27b.tar.gz
xrdp-proprietary-f0b6c6b1d178419ae82ad1c8ea2d74c97cc2f27b.zip
libxrdp: started adding TLS support
Diffstat (limited to 'common')
-rw-r--r--common/trans.c8
-rw-r--r--common/trans.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/common/trans.c b/common/trans.c
index 6fd5a9d8..421d5679 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -38,6 +38,8 @@ trans_create(int mode, int in_size, int out_size)
make_stream(self->out_s);
init_stream(self->out_s, out_size);
self->mode = mode;
+ self->do_tls = 0; /* default simple tcp layer */
+ self->tls = 0;
}
return self;
@@ -248,7 +250,7 @@ trans_check_wait_objs(struct trans *self)
if (to_read > 0)
{
- read_bytes = g_tcp_recv(self->sck, self->in_s->end, to_read, 0);
+ read_bytes = g_tcp_recv(self->sck, self->in_s->end, to_read, 0);
if (read_bytes == -1)
{
@@ -318,7 +320,9 @@ trans_force_read_s(struct trans *self, struct stream *in_s, int size)
{
return 1;
}
+
rcvd = g_tcp_recv(self->sck, in_s->end, size, 0);
+
if (rcvd == -1)
{
if (g_tcp_last_error_would_block(self->sck))
@@ -391,7 +395,7 @@ trans_force_write_s(struct trans *self, struct stream *out_s)
while (total < size)
{
- sent = g_tcp_send(self->sck, out_s->data + total, size - total, 0);
+ sent = g_tcp_send(self->sck, out_s->data + total, size - total, 0);
if (sent == -1)
{
diff --git a/common/trans.h b/common/trans.h
index 4a8b249c..a391309e 100644
--- a/common/trans.h
+++ b/common/trans.h
@@ -60,6 +60,8 @@ struct trans
char port[256];
int no_stream_init_on_data_in;
int extra_flags; /* user defined */
+ int do_tls; /* 0 - tcp, 1 - tls */
+ struct xrdp_tls *tls;
};
struct trans* APP_CC