On 05/01/2006, at 7:15 AM, Lars T. Mikkelsen wrote:

> On Wed, Jan 04, 2006 at 01:05:12PM +0100, Stian B. Barmen wrote:
>> But that seems to be minor, and not critical at least. But, if I try
>> from a Windows Messenger client (you remember, the very old one that
>> comes preinstalled in windows xp?) the sending never starts and my
>> jabber client never gets notified of an incoming file transfer. In
>> debug I get:
>>
>> 2006/01/04 12:56 CET [OneSwitchboardSession,client] Traceback (most 
>> recent call last):
> [snip]
>>           File "/usr/local/PyMSNt/src/tlib/msn/msn.py", line 823, in 
>> rawDataReceived
>>             self.currentMessage.readPos += len(data)
>>         exceptions.AttributeError: 'NoneType' object has no attribute 
>> 'readPos'
>>
>> 2006/01/04 12:56 CET [OneSwitchboardSession,client] Stopping factory 
>> <twisted.internet.protocol.ClientFactory instance at 0xb72852ac>
>
> I finally got access to a version of Windows Messenger (version 4.7),
> and I'm able to confirm this error. However, on the first attempt I get
> this traceback:
>
> 2006/01/04 19:33 CET [OneSwitchboardSession,client] Traceback (most 
> recent call last):
> [snip]
>           File "[...]/src/tlib/msn/msn.py", line 2093, in 
> _checkFileInvitation
>             connectivity = (info.get('Connectivity').lower() == 'y')
>         exceptions.AttributeError: 'NoneType' object has no attribute 
> 'lower'
>
> 2006/01/04 19:33 CET [OneSwitchboardSession,client] Stopping factory 
> <twisted.internet.protocol.ClientFactory instance at 0xb757efac>
>
> This exception occurs because the Connectivity header is missing (I
> think the header is optional). As far as I was able to determine, this
> error will eventually lead to the 'readPos' error on future file
> transfer attempts. When an exception occurs the ClientFactory is 
> stopped
> (as it can be seen above), however, the OneSwitchboardSession object is
> not destroyed nor removed from the switchboardSessions dictionary. So
> when the next file transfer attempt is made, the OneSwitchboardSession
> object is reused - and that object was in raw mode when the exception
> occurred.
>
> My initial idea to fix this problem, was to remove the corresponding
> OneSwitchboardSession object from switchboardSessions, if the
> ClientFactory is stopped. However, I couldn't figure out how to do 
> that.
>
> The current fix is to set the OneSwitchboardSession object to line mode
> if it is reused. However, I don't know if the object has other states
> that needs to be reset - or if it will break things to reset it to line
> mode. Perhaps it will be to complex to ensure that the
> OneSwitchboardSession object will be reusable after an exception has
> occurred, and we just have to ensure that exceptions do not occur.
>
>> Reproduce: send file from msn 7.5 = works, then send file from windows
>> messenger = fails, then send file from msn 7.5 = fails, then log
>> off-on transport, then file transfer from msn 7.5 = works.
>
> Windows Messenger seems to use an older protocol for file transfers
> (text/x-msmsgsinvite vs. application/x-msnmsgrp2p), that is not yet
> supported in PyMSNt. So even with the attached patch, you won't be able
> to receive files from Windows Messenger. However, you should be able to
> send a file from MSN Messenger after a failed transfer from Windows
> Messenger, without having to log out. It haven't tested it though.
>
> Best regards,
> Lars

Correct. Windows Messenger uses the old file transfer protocol, which 
isn't supported. It probably will be, but not before sending is added.

I've fixed SVN so that switchboard sessions shouldn't ever get stuck in 
raw mode again.

---

James

Reply via email to