Hello,
I've just had a closer look at what my PyICQt (v. 0.8 with eJabberd
1.1.3) is doing. I noticed that when I tried to send a message after
ICQt log-in there were many tracebacks like this:
> [2007-05-16 16:20:51] Traceback (most recent call last):
> File "/var/jabber/pyicq-t/src/tlib/oscar.py", line 642, in
> dataReceived
> state=func(flap)
> File "/var/jabber/pyicq-t/src/tlib/oscar.py", line 751, in
> oscar_Data
> d.callback(snac)
> File
> "/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line 229, in
> callback
> self._startRunCallbacks(result)
> File
> "/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line 294, in
> _startRunCallbacks
> self._runCallbacks()
> --- <exception caught here> ---
> File
> "/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line 307, in
> _runCallbacks
> self.result = callback(self.result, *args, **kw)
> File "/var/jabber/pyicq-t/src/tlib/oscar.py", line 2427, in
> _cbGetAway
> user, rest = self.parseUser(snac[5],1)
> File "/var/jabber/pyicq-t/src/tlib/oscar.py", line 880, in parseUser
> u = OSCARUser(name, warn, tlvs)
> File "/var/jabber/pyicq-t/src/tlib/oscar.py", line 274, in __init__
> self.onSince = struct.unpack('!L',v)[0]
> struct.error: unpack str size does not match format
The message would be delayed for a minute or so. Later during the
session, these tracebacks didn't appear anymore, and the delays were
gone quite completely.
So I created the logging patch I attached (oscar.py.diff), which
outputs things like contained in log3.txt (I stripped/replaced some
numbers etc).
I still get 40-60 seconds delay for the first messages I send, but
afterwards, those messages disappear and everything is fine.
Is anyone able to do something useful with this information? Maybe
I'll have another look later.
I just realized that this might be related to or the same as
<URL:http://www.blathersource.org/bugs_view.php?projid=pyicq-t&bugid=305>.
I notice that the contacts for whom such a message appears are away,
but they do appear online after that message.
Actually, now I suspect that messages are delayed until all these
incorrectly-processed status messages are received.
Regards,
Milan
--
--- pyicq-t/src/tlib/oscar.py.orig 2006-05-31 01:52:36.000000000 +0000
+++ pyicq-t/src/tlib/oscar.py 2007-05-16 18:20:49.000000000 +0000
@@ -271,9 +271,15 @@ class OSCARUser:
elif k == 0x0002: # account creation time
self.createdOn = struct.unpack('!L',v)[0]
elif k == 0x0003: # on-since
- self.onSince = struct.unpack('!L',v)[0]
+ if len(v) != 4:
+ log.msg('INVALID: got %r as on-since' % v)
+ else:
+ self.onSince = struct.unpack('!L',v)[0]
elif k == 0x0004: # idle time
- self.idleTime = struct.unpack('!H',v)[0]
+ if len(v) != 2:
+ log.msg('INVALID: got %r as idle time' % v)
+ else:
+ self.idleTime = struct.unpack('!H',v)[0]
elif k == 0x0005: # member since
self.memberSince = struct.unpack('!L',v)[0]
elif k == 0x0006: # icq online status and flags
[2007-05-16 19:07:03] _cbGetAway [2, 6, 0, 0, 21L, '\t123123123[snipped]']
[2007-05-16 19:07:03] INVALID: got 'text/x-aolrtf; charset="unicode-2-0"' as
on-since
# Every second byte stripped, the below is:
# '<html><body>Wahrscheinlich dr\xc3\xbcben Fu\xc3xball schauen.</body></html>'
[2007-05-16 19:07:03] INVALID: got
'\x00<\x00h\x00t\x00m\x00l\x00>\x00<\x00b\x00o\x00d\x00y\x00>\x00W\x00a\x00h\x00r\x00s\x00c\x00h\x00e\x00i\x00n\x00l\x00i\x00c\x00h\x00
\x00d\x00r\x00\xc3\x00\xbc\x00b\x00e\x00n\x00
\x00F\x00u\x00\xc3\x01x\x00b\x00a\x00l\x00l\x00
\x00s\x00c\x00h\x00a\x00u\x00e\x00n\x00.\x00<\x00/\x00b\x00o\x00d\x00y\x00>\x00<\x00/\x00h\x00t\x00m\x00l\x00>'
as idle time
[2007-05-16 19:07:03] unknown tlv for user 123123123
t: 0x27
v: 'FKP\xe3'
[2007-05-16 19:07:03] AIM Extended Status: user 123123123
v:
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
[2007-05-16 19:07:03] extracted icon hash: extflags = 0x1, iconhash =
11111111111111111111111111111111
[2007-05-16 19:07:03] INFO :: [EMAIL PROTECTED] :: icqt.B :: sendAwayPresence
:: {'status': u'', 'c': <contact.Contact instance at 0x2b35fe9e6638>, 'show':
'away', 'url': '', 'buddyjid': '[EMAIL PROTECTED]', 'charset': 'iso-8859-1',
'm': None, 'ptype': None, 'user': <OSCARUser 123123123, flags ['free', 'away',
'icq'], online for 378 minutes, idle for 23 minutes, caps ['icq5unknown1',
'icq_direct', 'sendfile', 'serv_rel', 'unicode']>, 'msg': [None, None],
'icq2jid': <function icq2jid at 0x2b35fe93d2a8>} :: Away (iso-8859-1, None)
message
[2007-05-16 19:07:03] INFO :: [EMAIL PROTECTED] :: Session :: sendPresence ::
{'status': 'Idle 23 minutes', 'show': 'away', 'url': None, 'fro': '[EMAIL
PROTECTED]', 'avatarHash': '', 'ptype': None, 'priority': None, 'to': u'[EMAIL
PROTECTED]', 'nickname': 'Matze', 'payload':
[<twisted.words.xish.domish.Element object at 0x2b35feb41e10>]} ::
[2007-05-16 19:07:03] INFO :: [EMAIL PROTECTED] :: buddies.BuddyList ::
updateSSIContact :: {'status': 'Idle 23 minutes', 'presence': None, 'url': '',
'show': 'away', 'ipaddr': '0.0.0.0', 'lanipport': 0L, 'nick': None, 'contact':
'123123123', 'lanipaddr': '0.0.0.0', 'icq2jid': <function icq2jid at
0x2b35fe93d2a8>, 'icqprotocol': 9} ::
[2007-05-16 19:07:06] _cbGetAway [2, 6, 0, 0, 22L, '\t134134134[snipped]']
[2007-05-16 19:07:06] INVALID: got 'text/x-aolrtf; charset="us-ascii"' as
on-since
[2007-05-16 19:07:06] INVALID: got '<html><body>User is currently
away.</body></html>' as idle time
[2007-05-16 19:07:06] unknown tlv for user 134134134
t: 0x27
v: 'FK%^'
[2007-05-16 19:07:06] INFO :: [EMAIL PROTECTED] :: icqt.B :: sendAwayPresence
:: {'status': u'', 'c': <contact.Contact instance at 0x2b35feb3fe60>, 'show':
'xa', 'url': '', 'buddyjid': '[EMAIL PROTECTED]', 'charset': 'iso-8859-1', 'm':
None, 'ptype': None, 'user': <OSCARUser 134134134, flags ['free', 'away',
'icq'], online for 782 minutes, idle for 211 minutes, caps ['icq5unknown1',
'icq_direct', 'sendfile', 'serv_rel', 'unicode']>, 'msg': [None, None],
'icq2jid': <function icq2jid at 0x2b35fe93d2a8>} :: Away (iso-8859-1, None)
message
[2007-05-16 19:07:06] INFO :: [EMAIL PROTECTED] :: Session :: sendPresence ::
{'status': 'Idle 3 hours', 'show': 'xa', 'url': None, 'fro': '[EMAIL
PROTECTED]', 'avatarHash': '', 'ptype': None, 'priority': None, 'to': u'[EMAIL
PROTECTED]', 'nickname': u'Ralf', 'payload':
[<twisted.words.xish.domish.Element object at 0x2b35fe9b1fd0>]} ::
[2007-05-16 19:07:06] INFO :: [EMAIL PROTECTED] :: buddies.BuddyList ::
updateSSIContact :: {'status': 'Idle 3 hours', 'presence': None, 'url': '',
'show': 'xa', 'ipaddr': '0.0.0.0', 'lanipport': 0L, 'nick': None, 'contact':
'134134134', 'lanipaddr': '0.0.0.0', 'icq2jid': <function icq2jid at
0x2b35fe93d2a8>, 'icqprotocol': 9} ::
pgp4ckOgHfyIk.pgp
Description: PGP signature
_______________________________________________ py-transports mailing list [email protected] http://lists.modevia.com/cgi-bin/mailman/listinfo/py-transports
