~ubuntu-branches/ubuntu/utopic/freerdp/utopic

« back to all changes in this revision

Viewing changes to libfreerdp-core/transport.c

  • Committer: Package Import Robot
  • Author(s): Otavio Salvador, Jeremy Bicha
  • Date: 2012-02-11 10:34:05 UTC
  • mfrom: (1.1.7) (9.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120211103405-mk0gjhjn70eeyxul
Tags: 1.0.1-1
[ Jeremy Bicha ]
* New upstream release. Closes: #659332.
* Updated symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
boolean transport_connect_tls(rdpTransport* transport)
86
86
{
87
87
        if (transport->tls == NULL)
88
 
                transport->tls = tls_new();
 
88
                transport->tls = tls_new(transport->settings);
89
89
 
90
90
        transport->layer = TRANSPORT_LAYER_TLS;
91
91
        transport->tls->sockfd = transport->tcp->sockfd;
99
99
boolean transport_connect_nla(rdpTransport* transport)
100
100
{
101
101
        if (transport->tls == NULL)
102
 
                transport->tls = tls_new();
 
102
                transport->tls = tls_new(transport->settings);
103
103
 
104
104
        transport->layer = TRANSPORT_LAYER_TLS;
105
105
        transport->tls->sockfd = transport->tcp->sockfd;
139
139
boolean transport_accept_tls(rdpTransport* transport)
140
140
{
141
141
        if (transport->tls == NULL)
142
 
                transport->tls = tls_new();
 
142
                transport->tls = tls_new(transport->settings);
143
143
 
144
144
        transport->layer = TRANSPORT_LAYER_TLS;
145
145
        transport->tls->sockfd = transport->tcp->sockfd;
153
153
boolean transport_accept_nla(rdpTransport* transport)
154
154
{
155
155
        if (transport->tls == NULL)
156
 
                transport->tls = tls_new();
 
156
                transport->tls = tls_new(transport->settings);
157
157
 
158
158
        transport->layer = TRANSPORT_LAYER_TLS;
159
159
        transport->tls->sockfd = transport->tcp->sockfd;
221
221
{
222
222
        int status = -1;
223
223
        int length;
224
 
        int sent = 0;
225
224
 
226
225
        length = stream_get_length(s);
227
226
        stream_set_pos(s, 0);
234
233
        }
235
234
#endif
236
235
 
237
 
        while (sent < length)
 
236
        while (length > 0)
238
237
        {
239
238
                if (transport->layer == TRANSPORT_LAYER_TLS)
240
239
                        status = tls_write(transport->tls, stream_get_tail(s), length);
258
257
                        }
259
258
                }
260
259
 
261
 
                sent += status;
 
260
                length -= status;
262
261
                stream_seek(s, status);
263
262
        }
264
263
 
313
312
                                stream_set_pos(transport->recv_buffer, pos);
314
313
                                return 0;
315
314
                        }
 
315
                        /* Fastpath header can be two or three bytes long. */
 
316
                        length = fastpath_header_length(transport->recv_buffer);
 
317
                        if (pos < length)
 
318
                        {
 
319
                                stream_set_pos(transport->recv_buffer, pos);
 
320
                                return 0;
 
321
                        }
316
322
                        length = fastpath_read_header(NULL, transport->recv_buffer);
317
323
                }
318
324