Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/xmpp/filetransfer.py')
-rw-r--r--src/common/xmpp/filetransfer.py57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/common/xmpp/filetransfer.py b/src/common/xmpp/filetransfer.py
index 6624a1143..bf0451242 100644
--- a/src/common/xmpp/filetransfer.py
+++ b/src/common/xmpp/filetransfer.py
@@ -58,14 +58,16 @@ class IBB(PlugIn):
def StreamOpenHandler(self,conn,stanza):
""" Handles opening of new incoming stream. Used internally. """
- # <iq type='set'
- # from='romeo@montague.net/orchard'
- # to='juliet@capulet.com/balcony'
- # id='inband_1'>
- # <open sid='mySID'
- # block-size='4096'
- # xmlns='http://jabber.org/protocol/ibb'/>
- # </iq>
+ """
+<iq type='set'
+ from='romeo@montague.net/orchard'
+ to='juliet@capulet.com/balcony'
+ id='inband_1'>
+ <open sid='mySID'
+ block-size='4096'
+ xmlns='http://jabber.org/protocol/ibb'/>
+</iq>
+"""
err=None
sid,blocksize=stanza.getTagAttr('open','sid'),stanza.getTagAttr('open','block-size')
self.DEBUG('StreamOpenHandler called sid->%s blocksize->%s'%(sid,blocksize),'info')
@@ -99,8 +101,7 @@ class IBB(PlugIn):
self.DEBUG('SendHandler called','info')
for sid in self._streams.keys():
stream=self._streams[sid]
- if stream['direction'][:2]=='|>':
- pass
+ if stream['direction'][:2]=='|>': cont=1
elif stream['direction'][0]=='>':
chunk=stream['fp'].read(stream['block-size'])
if chunk:
@@ -109,27 +110,29 @@ class IBB(PlugIn):
if stream['seq']==65536: stream['seq']=0
conn.send(Protocol('message',stream['direction'][1:],payload=[datanode,self._ampnode]))
else:
- # notify the other side about stream closing
- # notify the local user about sucessfull send
- # delete the local stream
+ """ notify the other side about stream closing
+ notify the local user about sucessfull send
+ delete the local stream"""
conn.send(Protocol('iq',stream['direction'][1:],'set',payload=[Node(NS_IBB+' close',{'sid':sid})]))
conn.Event(self.DBG_LINE,'SUCCESSFULL SEND',stream)
del self._streams[sid]
self._owner.UnregisterCycleHandler(self.SendHandler)
-# <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='msg1'>
-# <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'>
-# qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ
-# WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu
-# IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P
-# AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH
-# kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA
-# </data>
-# <amp xmlns='http://jabber.org/protocol/amp'>
-# <rule condition='deliver-at' value='stored' action='error'/>
-# <rule condition='match-resource' value='exact' action='error'/>
-# </amp>
-# </message>
+ """
+<message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='msg1'>
+ <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'>
+ qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ
+ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu
+ IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P
+ AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH
+ kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA
+ </data>
+ <amp xmlns='http://jabber.org/protocol/amp'>
+ <rule condition='deliver-at' value='stored' action='error'/>
+ <rule condition='match-resource' value='exact' action='error'/>
+ </amp>
+</message>
+"""
def ReceiveHandler(self,conn,stanza):
""" Receive next portion of incoming datastream and store it write
@@ -195,4 +198,4 @@ class IBB(PlugIn):
conn.Event(self.DBG_LINE,'STREAM COMMITTED',stream)
else: conn.send(Error(stanza,ERR_UNEXPECTED_REQUEST))
-# vim: se ts=3:
+# vim: se ts=3: \ No newline at end of file