[Dave Cridland] Fix BOSH for bodies with "\r\n" sequences

This commit is contained in:
Yann Leboulanger 2011-06-13 18:14:45 +02:00
parent 635d9a02d5
commit 3927db7c5c
1 changed files with 3 additions and 3 deletions

View File

@ -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:]