| 315 if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) |
315 if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) |
| 316 /* No worries */ |
316 /* No worries */ |
| 317 return; |
317 return; |
| 318 |
318 |
| 319 peer_connection_destroy(conn, |
319 peer_connection_destroy(conn, |
| 320 OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); |
320 OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno)); |
| 321 return; |
321 return; |
| 322 } |
322 } |
| 323 |
323 |
| 324 conn->lastactivity = time(NULL); |
324 conn->lastactivity = time(NULL); |
| 325 |
325 |
| 365 if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) |
365 if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) |
| 366 /* No worries */ |
366 /* No worries */ |
| 367 return; |
367 return; |
| 368 |
368 |
| 369 peer_connection_destroy(conn, |
369 peer_connection_destroy(conn, |
| 370 OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); |
370 OSCAR_DISCONNECT_LOST_CONNECTION, g_strerror(errno)); |
| 371 return; |
371 return; |
| 372 } |
372 } |
| 373 |
373 |
| 374 conn->lastactivity = time(NULL); |
374 conn->lastactivity = time(NULL); |
| 375 conn->buffer_incoming.offset += read; |
375 conn->buffer_incoming.offset += read; |
| 631 /* Invalid connection type?! Continue waiting. */ |
632 /* Invalid connection type?! Continue waiting. */ |
| 632 close(conn->fd); |
633 close(conn->fd); |
| 633 return; |
634 return; |
| 634 } |
635 } |
| 635 |
636 |
| 636 fcntl(conn->fd, F_SETFL, O_NONBLOCK); |
637 flags = fcntl(conn->fd, F_GETFL); |
| |
638 fcntl(conn->fd, F_SETFL, flags | O_NONBLOCK); |
| 637 purple_input_remove(conn->watcher_incoming); |
639 purple_input_remove(conn->watcher_incoming); |
| 638 |
640 |
| 639 peer_connection_finalize_connection(conn); |
641 peer_connection_finalize_connection(conn); |
| 640 } |
642 } |
| 641 |
643 |