# HG changeset patch # User Tim Ringenbach # Date 1093200633 0 # Node ID e8334906b2fbcea6082e9f47b89e73a984797c06 # Parent 430ef8fc963d4a8b0d911f98786216ae905ed34f [gaim-migrate @ 10699] This stops you from sending a message that's too large on Yahoo! Thanks to Joe Shaw for pointing out a 2000 byte limit, which I haven't bothered to double check myself yet. He provided his own patch, but I did this instead, because he was dropping all packets over 2000 bytes, and I'm not completely sure that's needed yet, and this way is less likely to break something. Hmm I wonder how large conferences work. committer: Tailor Script diff -r 430ef8fc963d -r e8334906b2fb src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Sun Aug 22 18:24:33 2004 +0000 +++ b/src/protocols/yahoo/yahoo.c Sun Aug 22 18:50:33 2004 +0000 @@ -2836,6 +2836,7 @@ char *msg = yahoo_html_to_codes(what); char *msg2; gboolean utf8 = TRUE; + int ret = 1; msg2 = yahoo_string_encode(gc, msg, &utf8); @@ -2853,14 +2854,18 @@ else yahoo_packet_hash(pkt, 206, "2"); - yahoo_send_packet(yd, pkt); + /* We may need to not send any packets over 2000 bytes, but I'm not sure yet. */ + if ((YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt)) <= 2000) + yahoo_send_packet(yd, pkt); + else + ret = -E2BIG; yahoo_packet_free(pkt); g_free(msg); g_free(msg2); - return 1; + return ret; } int yahoo_send_typing(GaimConnection *gc, const char *who, int typ)