summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-05-22 21:50:48 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-03-04 08:03:33 -0600
commit0aa0e3d300bf8cd5aa4c95d338460e652eac3834 (patch)
tree49796613f98eaf5ea993b1615eb2ab7878c90d48 /common
parent0cddb71c7e75520c9d272697b8eb57dbc03ab296 (diff)
downloadxrdp-proprietary-0aa0e3d300bf8cd5aa4c95d338460e652eac3834.tar.gz
xrdp-proprietary-0aa0e3d300bf8cd5aa4c95d338460e652eac3834.zip
Fix a number of problems
System is now mostly stabilized
Diffstat (limited to 'common')
-rw-r--r--common/defines.h2
-rw-r--r--common/trans.c50
2 files changed, 52 insertions, 0 deletions
diff --git a/common/defines.h b/common/defines.h
index c6e85a08..f4023d4c 100644
--- a/common/defines.h
+++ b/common/defines.h
@@ -21,6 +21,8 @@
#ifndef DEFINES_H
#define DEFINES_H
+#define DISABLE_UNIX_DOMAIN_SOCKETS 1
+
/* check for debug */
#ifdef XRDP_DEBUG
#define DEBUG(args) g_writeln args;
diff --git a/common/trans.c b/common/trans.c
index 6fd5a9d8..e572dc15 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -367,6 +367,7 @@ trans_force_read(struct trans *self, int size)
return trans_force_read_s(self, self->in_s, size);
}
+#if 0
/*****************************************************************************/
int APP_CC
trans_force_write_s(struct trans *self, struct stream *out_s)
@@ -432,6 +433,55 @@ trans_force_write_s(struct trans *self, struct stream *out_s)
return 0;
}
+#else
+// DEBUG ONLY
+/*****************************************************************************/
+int APP_CC
+trans_force_write_s(struct trans* self, struct stream* out_s)
+{
+ int size;
+ int total;
+ int sent;
+
+ if (self->status != TRANS_STATUS_UP)
+ {
+ return 1;
+ }
+ size = (int)(out_s->end - out_s->data);
+ total = 0;
+ while (total < size)
+ {
+ sent = g_tcp_send(self->sck, out_s->data + total, size - total, 0);
+ if (sent == -1)
+ {
+ if (g_tcp_last_error_would_block(self->sck))
+ {
+ if (!g_tcp_can_send(self->sck, 10))
+ {
+ /* check for term here */
+ }
+ }
+ else
+ {
+ /* error */
+ self->status = TRANS_STATUS_DOWN;
+ return 2;
+ }
+ }
+ else if (sent == 0)
+ {
+ /* error */
+ self->status = TRANS_STATUS_DOWN;
+ return 3;
+ }
+ else
+ {
+ total = total + sent;
+ }
+ }
+ return 0;
+}
+#endif
/*****************************************************************************/
int APP_CC