diff options
| author | Timothy Pearson <tpearson@raptorengineering.com> | 2019-03-02 19:39:52 -0600 |
|---|---|---|
| committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-03-02 19:49:22 -0600 |
| commit | 315b8914c853078d8bb04a7d16e47d19128ca318 (patch) | |
| tree | 5e64fe8ea46443663d287360c5b6b45aea095fb1 /common/trans.c | |
| parent | 58e06a0aa7db8e0762b31304ead0c3e0df5a7be4 (diff) | |
| download | xrdp-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/trans.c')
| -rw-r--r-- | common/trans.c | 50 |
1 files changed, 50 insertions, 0 deletions
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 |
