comparison libpurple/protocols/oscar/flap_connection.c @ 30826:bbb27d65681f

Bstream cleanups: 1. g_return_val_if_fail()'s in place of XXX's. 2. byte_stream_empty() -> byte_stream_bytes_left(). I think the world is a better place now.
author ivan.komarov@soc.pidgin.im
date Wed, 28 Jul 2010 23:53:25 +0000
parents 553cd883a29a
children 11c54d781835
comparison
equal deleted inserted replaced
30825:a4f579485ce6 30826:bbb27d65681f
731 parse_snac(OscarData *od, FlapConnection *conn, FlapFrame *frame) 731 parse_snac(OscarData *od, FlapConnection *conn, FlapFrame *frame)
732 { 732 {
733 aim_module_t *cur; 733 aim_module_t *cur;
734 aim_modsnac_t snac; 734 aim_modsnac_t snac;
735 735
736 if (byte_stream_empty(&frame->data) < 10) 736 if (byte_stream_bytes_left(&frame->data) < 10)
737 return; 737 return;
738 738
739 snac.family = byte_stream_get16(&frame->data); 739 snac.family = byte_stream_get16(&frame->data);
740 snac.subtype = byte_stream_get16(&frame->data); 740 snac.subtype = byte_stream_get16(&frame->data);
741 snac.flags = byte_stream_get16(&frame->data); 741 snac.flags = byte_stream_get16(&frame->data);
798 parse_flap_ch4(OscarData *od, FlapConnection *conn, FlapFrame *frame) 798 parse_flap_ch4(OscarData *od, FlapConnection *conn, FlapFrame *frame)
799 { 799 {
800 GSList *tlvlist; 800 GSList *tlvlist;
801 char *msg = NULL; 801 char *msg = NULL;
802 802
803 if (byte_stream_empty(&frame->data) == 0) { 803 if (byte_stream_bytes_left(&frame->data) == 0) {
804 /* XXX should do something with this */ 804 /* XXX should do something with this */
805 return; 805 return;
806 } 806 }
807 807
808 /* An ICQ account is logging in */ 808 /* An ICQ account is logging in */
1060 { 1060 {
1061 if (conn == NULL) 1061 if (conn == NULL)
1062 return; 1062 return;
1063 1063
1064 /* Make sure we don't send past the end of the bs */ 1064 /* Make sure we don't send past the end of the bs */
1065 if (count > byte_stream_empty(bs)) 1065 if (count > byte_stream_bytes_left(bs))
1066 count = byte_stream_empty(bs); /* truncate to remaining space */ 1066 count = byte_stream_bytes_left(bs); /* truncate to remaining space */
1067 1067
1068 if (count == 0) 1068 if (count == 0)
1069 return; 1069 return;
1070 1070
1071 /* Add everything to our outgoing buffer */ 1071 /* Add everything to our outgoing buffer */