msimprpl status update

Jeff Connelly shellreef at gmail.com
Sun Jan 27 00:15:19 EST 2008


This week I spent some time trying to get my build environments
working correctly. Apparently Xilinx software, which I am using for a
microcontroller programming course, installs its own copy of Cygwin
that conflicted with the Cygwin I installed to build Pidgin. This took
a while to diagnose but reinstalling Cygwin fixed the problem. I also
flirted with building Adium with a modified libpurple, but
difficulties arose when Adium's patches only worked against the latest
release of Pidgin, 2.3.1, and not the latest sources from Monotone. I
may investigate this further later, in order to test the
cross-platform aspects of msimprpl. I also installed Linux, which I
haven't had recently since I got a new computer. The MySpaceIM
protocol plugin is easier to debug on Linux, but many of the bugs are
only visible on Windows.

I focused on one important bug this week:
http://developer.pidgin.im/ticket/4621 "MySpace IM causing program
freeze at login attempt". I was able to reproduce it on Mac OS X and
Windows, and isolate the problem to a full read buffer. Msimprpl
previously used a 15 KB read buffer to receive incoming messages, but
if you have a large number of buddies, the MySpaceIM servers will send
all their presence updates and status information in a message that
was too large to fit in the fixed buffer. This should fail hard, since
I did check if there was no more space in the buffer and signal a
connection error if so, but a missing return statement caused the
program to continue execution to a while() loop where msim_parse() was
repeatedly called on the partial message, causing the hang.

To fix this, besides adding the missing return statement, I extended
msim_input_cb() to grow the read buffer if necessary, in the same way
the IRC protocol plugin operates. I tested the change by logging onto
an account with 262 buddies. The buffer grew in size once, and all was
well.

However, there is a noticeable delay when signing onto a MySpaceIM
account with 262 buddies, as msimprpl processes each status update
from the server. This delay may be unavoidable, but I filed
http://developer.pidgin.im/ticket/4734 in order to analyze ways to
speed up the process.

That's about it for this week. One critical bug down, three more to go.

-Jeff




More information about the Devel mailing list