Mercurial > pidgin
comparison libpurple/protocols/oscar/oft.c @ 31965:7c65c7054905
Convert the oscar prpl to use the new API.
author | andrew.victor@mxit.com |
---|---|
date | Fri, 26 Aug 2011 19:11:09 +0000 |
parents | de168bbf1e43 |
children | b6defcebfe4b |
comparison
equal
deleted
inserted
replaced
31964:ac88c8fc3f47 | 31965:7c65c7054905 |
---|---|
587 void | 587 void |
588 peer_oft_recvcb_init(PurpleXfer *xfer) | 588 peer_oft_recvcb_init(PurpleXfer *xfer) |
589 { | 589 { |
590 PeerConnection *conn; | 590 PeerConnection *conn; |
591 | 591 |
592 conn = xfer->data; | 592 conn = purple_xfer_get_protocol_data(xfer); |
593 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; | 593 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; |
594 peer_connection_trynext(conn); | 594 peer_connection_trynext(conn); |
595 } | 595 } |
596 | 596 |
597 void | 597 void |
598 peer_oft_recvcb_end(PurpleXfer *xfer) | 598 peer_oft_recvcb_end(PurpleXfer *xfer) |
599 { | 599 { |
600 PeerConnection *conn; | 600 PeerConnection *conn; |
601 | 601 |
602 conn = xfer->data; | 602 conn = purple_xfer_get_protocol_data(xfer); |
603 | 603 |
604 /* Tell the other person that we've received everything */ | 604 /* Tell the other person that we've received everything */ |
605 conn->fd = conn->xfer->fd; | 605 conn->fd = conn->xfer->fd; |
606 conn->xfer->fd = -1; | 606 conn->xfer->fd = -1; |
607 peer_oft_send_done(conn); | 607 peer_oft_send_done(conn); |
615 peer_oft_recvcb_ack_recv(PurpleXfer *xfer, const guchar *buffer, size_t size) | 615 peer_oft_recvcb_ack_recv(PurpleXfer *xfer, const guchar *buffer, size_t size) |
616 { | 616 { |
617 PeerConnection *conn; | 617 PeerConnection *conn; |
618 | 618 |
619 /* Update our rolling checksum. Like Walmart, yo. */ | 619 /* Update our rolling checksum. Like Walmart, yo. */ |
620 conn = xfer->data; | 620 conn = purple_xfer_get_protocol_data(xfer); |
621 conn->xferdata.recvcsum = peer_oft_checksum_chunk(buffer, | 621 conn->xferdata.recvcsum = peer_oft_checksum_chunk(buffer, |
622 size, conn->xferdata.recvcsum, purple_xfer_get_bytes_sent(xfer) & 1); | 622 size, conn->xferdata.recvcsum, purple_xfer_get_bytes_sent(xfer) & 1); |
623 } | 623 } |
624 | 624 |
625 /*******************************************************************/ | 625 /*******************************************************************/ |
651 peer_oft_sendcb_init(PurpleXfer *xfer) | 651 peer_oft_sendcb_init(PurpleXfer *xfer) |
652 { | 652 { |
653 PeerConnection *conn; | 653 PeerConnection *conn; |
654 size_t size; | 654 size_t size; |
655 | 655 |
656 conn = xfer->data; | 656 conn = purple_xfer_get_protocol_data(xfer); |
657 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; | 657 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; |
658 | 658 |
659 /* Make sure the file size can be represented in 32 bits */ | 659 /* Make sure the file size can be represented in 32 bits */ |
660 size = purple_xfer_get_size(xfer); | 660 size = purple_xfer_get_size(xfer); |
661 if (size > G_MAXUINT32) | 661 if (size > G_MAXUINT32) |
711 void | 711 void |
712 peer_oft_sendcb_ack(PurpleXfer *xfer, const guchar *buffer, size_t size) | 712 peer_oft_sendcb_ack(PurpleXfer *xfer, const guchar *buffer, size_t size) |
713 { | 713 { |
714 PeerConnection *conn; | 714 PeerConnection *conn; |
715 | 715 |
716 conn = xfer->data; | 716 conn = purple_xfer_get_protocol_data(xfer); |
717 | 717 |
718 /* | 718 /* |
719 * If we're done sending, intercept the socket from the core ft code | 719 * If we're done sending, intercept the socket from the core ft code |
720 * and wait for the other guy to send the "done" OFT packet. | 720 * and wait for the other guy to send the "done" OFT packet. |
721 */ | 721 */ |
740 void | 740 void |
741 peer_oft_cb_generic_cancel(PurpleXfer *xfer) | 741 peer_oft_cb_generic_cancel(PurpleXfer *xfer) |
742 { | 742 { |
743 PeerConnection *conn; | 743 PeerConnection *conn; |
744 | 744 |
745 conn = xfer->data; | 745 conn = purple_xfer_get_protocol_data(xfer); |
746 | 746 |
747 if (conn == NULL) | 747 if (conn == NULL) |
748 return; | 748 return; |
749 | 749 |
750 peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); | 750 peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); |