diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2011-06-13 20:14:45 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2011-06-13 20:14:45 +0400 |
commit | 3927db7c5ce521270ac841a1677319a05ba4b330 (patch) | |
tree | 9c30a89636523ffc13cf557f7a502b68974cb55a /src/common/xmpp | |
parent | 635d9a02d590241cb47d33d421534e3d449a50b7 (diff) |
[Dave Cridland] Fix BOSH for bodies with "\r\n" sequences
Diffstat (limited to 'src/common/xmpp')
-rw-r--r-- | src/common/xmpp/transports_nb.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/xmpp/transports_nb.py b/src/common/xmpp/transports_nb.py index 2b0a57c9d..9430ef654 100644 --- a/src/common/xmpp/transports_nb.py +++ b/src/common/xmpp/transports_nb.py @@ -740,15 +740,15 @@ class NonBlockingHTTP(NonBlockingTCP): httpbody - string with http body) http_rest - what is left in the message after a full HTTP header + body """ - message = message.replace('\r', '') - message = message.lstrip('\n') - splitted = message.split('\n\n') + splitted = message.split('\r\n\r\n') if len(splitted) < 2: # no complete http message. Keep filling the buffer until we find one buffer_rest = message return ('', '', '', buffer_rest) else: (header, httpbody) = splitted[:2] + header = header.replace('\r', '') + header = header.lstrip('\n') header = header.split('\n') statusline = header[0].split(' ', 2) header = header[1:] |