Lines 1318-1340
gint fd_write(gint fd, const gchar *buf, gint len)
Link Here
|
1318 |
#if USE_GNUTLS |
1318 |
#if USE_GNUTLS |
1319 |
static gint ssl_write(gnutls_session_t ssl, const gchar *buf, gint len) |
1319 |
static gint ssl_write(gnutls_session_t ssl, const gchar *buf, gint len) |
1320 |
{ |
1320 |
{ |
1321 |
gint ret; |
1321 |
ssize_t ret; |
1322 |
|
1322 |
|
1323 |
if (fd_check_io(GPOINTER_TO_INT(gnutls_transport_get_ptr(ssl)), G_IO_OUT) < 0) |
1323 |
if (fd_check_io(GPOINTER_TO_INT(gnutls_transport_get_ptr(ssl)), G_IO_OUT) < 0) |
1324 |
return -1; |
1324 |
return -1; |
1325 |
|
1325 |
|
1326 |
ret = gnutls_record_send(ssl, buf, len); |
1326 |
do { |
1327 |
|
1327 |
ret = gnutls_record_send(ssl, buf, len); |
1328 |
switch (ret) { |
1328 |
} while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED); |
1329 |
case 0: |
|
|
1330 |
return -1; |
1331 |
case GNUTLS_E_AGAIN: |
1332 |
case GNUTLS_E_INTERRUPTED: |
1333 |
return 0; |
1334 |
|
1329 |
|
1335 |
default: |
1330 |
return ret; |
1336 |
return ret; |
|
|
1337 |
} |
1338 |
} |
1331 |
} |
1339 |
|
1332 |
|
1340 |
#endif |
1333 |
#endif |