libpurple/protocols/oscar/peer.c

changeset 21453
a90cf329cd48
parent 21233
e75de8db4f2b
parent 21389
e1dd8142bb87
child 21630
591a79c1b295
equal deleted inserted replaced
21273:2f91b326b3f0 21453:a90cf329cd48
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;
605 PeerConnection *conn; 605 PeerConnection *conn;
606 OscarData *od; 606 OscarData *od;
607 PurpleConnection *gc; 607 PurpleConnection *gc;
608 struct sockaddr addr; 608 struct sockaddr addr;
609 socklen_t addrlen = sizeof(addr); 609 socklen_t addrlen = sizeof(addr);
610 int flags;
610 611
611 conn = data; 612 conn = data;
612 od = conn->od; 613 od = conn->od;
613 gc = od->gc; 614 gc = od->gc;
614 615
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

mercurial