summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineering.com>2019-03-02 19:39:52 -0600
committerTimothy Pearson <tpearson@raptorengineering.com>2019-03-02 19:49:22 -0600
commit315b8914c853078d8bb04a7d16e47d19128ca318 (patch)
tree5e64fe8ea46443663d287360c5b6b45aea095fb1 /common
parent58e06a0aa7db8e0762b31304ead0c3e0df5a7be4 (diff)
downloadxrdp-proprietary-315b8914c853078d8bb04a7d16e47d19128ca318.tar.gz
xrdp-proprietary-315b8914c853078d8bb04a7d16e47d19128ca318.zip
Second batch of initial commits:
* Add server/group pamming * Partially fix immediate exit after login Still will not compile due to libraptorsmiface being too new
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 d87ddae7..74723f45 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 5909e4eb..84fafe43 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -512,6 +512,7 @@ trans_force_read(struct trans *self, int size)
}
/*****************************************************************************/
+#if 0
int
trans_force_write_s(struct trans *self, struct stream *out_s)
{
@@ -571,6 +572,55 @@ trans_force_write_s(struct trans *self, struct stream *out_s)
}
return 0;
}
+#else
+// DEBUG
+/*****************************************************************************/
+int
+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