Issue 146: ICQ connection lost on recieving message containing only "<a>" from qip
Reported by galki...@gmail.com, Dec 14, 2008
If a message containig only 3 characters "<a>" (looks like html tag, but 
really contact just manually typed them in his chat window) is recieved 
from qip client (maybe some other clients too) pyicqt closes connection 
abnoramally with following exception:

ICQ connection lost! Reason: [Failure instance: Traceback (failure with no 
frames): exceptions.IndexError: list index out of range
]

This problem exist in pyicqt 0.8.1b3 and maybe all earlier versions.
Dec 15, 2008
Project Member #1 r000ns...@gmail.com
I can't confirm this error. Please, show log of transport if it's reproducible
Labels: Version0.8.1b3
Dec 15, 2008
Project Member #2 r000ns...@gmail.com
(No comment was entered for this change.)
Labels: -Version0.8.1b3 Version-0.8.1b3
Dec 15, 2008
#3 Mur...@gmail.com
I have checked this on transport pyicqt-0.8.1b3 (Debian Lenny AMD64) with Gmail as
Jabber server. Client for sending and receiving is PSI 0.13 svn. Messages like '<a>'
sends and receives normally without crashes.
Dec 17, 2008
#4 galki...@gmail.com
It looks like problem appears only when recieving such messgaes from qip (sending 
such message from most other clients does not lead to disconnect). 

I have checked with ICQ Transport 0.8.1/Python 2.5.2/linux2, Twisted 8.1.0
Error is always reproducible:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 51, in 
callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 36, in 
callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 59, in 
callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 37, in 
callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/lib/python2.5/site-packages/twisted/internet/epollreactor.py", line 
231, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 362, in 
doRead
    return self.protocol.dataReceived(data)
  File "/home/g/bin/piycqt/pyicqt-0.8.1-git/src/tlib/oscar.py", line 702, in 
dataReceived
    state=func(flap)
  File "/home/g/bin/piycqt/pyicqt-0.8.1-git/src/tlib/oscar.py", line 837, in 
oscar_Data
    func(snac)
  File "/home/g/bin/piycqt/pyicqt-0.8.1-git/src/tlib/oscar.py", line 1684, in 
oscar_04_07
    self.receiveMessage(user, multiparts, flags, delay)
  File "/home/g/bin/piycqt/pyicqt-0.8.1-git/src/legacy/icqt.py", line 504, in 
receiveMessage
    text = multiparts[0][0]

Debug output before traceback:

[2008-12-18 08:06:53] channel = 1
[2008-12-18 08:06:53] unknown tlv for user *********
        t: 0x29
        v: 'IF_\xb7'
[2008-12-18 08:06:53] user = <OSCARUser *********, flags ['unconfirmed', 'free', 
'icq'], online for 0 minutes, idle for 0 minutes>, data = 
0002000e05010002010601010004000
20000000b0000001600044949daa60013000184
[2008-12-18 08:06:53] tlvs = {19: '\x84', 2: 
'\x05\x01\x00\x02\x01\x06\x01\x01\x00\x04\x00\x02\x00\x00', 11: '', 22: 'II\xda\xa6'}
[2008-12-18 08:06:53] unknown TLV for incoming IM, 0013, '\x84'
[2008-12-18 08:06:53] Message data: 
'\x05\x01\x00\x02\x01\x06\x01\x01\x00\x04\x00\x02\x00\x00'
[2008-12-18 08:06:53] Timestamp: (1229576870,), datetime 2008-12-18 05:07:50
[2008-12-18 08:06:53] Multiparts: []
[2008-12-18 08:06:53] Flags: ['typingnot']
[2008-12-18 08:06:53] INFO :: admin@localhost :: buddies.BuddyList :: setUserVars :: 
{'uvars': {'utf8_msg_using': 0}, 'contact': '*********'} :: 
[2008-12-18 08:06:53] Sending confirmation for incoming message to *********
[2008-12-18 08:06:53] INFO :: admin@localhost :: icqt.B :: receiveMessage :: 
{'delay': '2008-12-18T05:07:50Z', 'icq2jid': <function icq2jid at 0x8c0da74>, 
'flags': ['typingnot'], 'multiparts': [], 'user': <OSCARUser *********, flags 
['unconfirmed', 'free', 'icq'], online for 0 minutes, idle for 0 minutes>} :: 
********* [] ['typingnot']

Dec 17, 2008
#5 galki...@gmail.com
It seems that empty message is recieved from icq server and such situation is not 
handled correctly.
Dec 18, 2008
Project Member #6 r000ns...@gmail.com
Test it, please: http://groups.google.com/group/py-transports/web/pyicqt-0.8.1-git.tar.gz
Status: Accepted
Owner: r000nster
Labels: Component-Logic Milestone-0.8.1.1
Dec 18, 2008
#7 galki...@gmail.com
thanks, in this version the issue is fixed.
Dec 18, 2008
Project Member #8 r000ns...@gmail.com
Fine
Status: Verified