[Dave Cridland] Fix BOSH for bodies with "\r\n" sequences
This commit is contained in:
parent
635d9a02d5
commit
3927db7c5c
|
@ -740,15 +740,15 @@ class NonBlockingHTTP(NonBlockingTCP):
|
||||||
httpbody - string with http body)
|
httpbody - string with http body)
|
||||||
http_rest - what is left in the message after a full HTTP header + body
|
http_rest - what is left in the message after a full HTTP header + body
|
||||||
"""
|
"""
|
||||||
message = message.replace('\r', '')
|
splitted = message.split('\r\n\r\n')
|
||||||
message = message.lstrip('\n')
|
|
||||||
splitted = message.split('\n\n')
|
|
||||||
if len(splitted) < 2:
|
if len(splitted) < 2:
|
||||||
# no complete http message. Keep filling the buffer until we find one
|
# no complete http message. Keep filling the buffer until we find one
|
||||||
buffer_rest = message
|
buffer_rest = message
|
||||||
return ('', '', '', buffer_rest)
|
return ('', '', '', buffer_rest)
|
||||||
else:
|
else:
|
||||||
(header, httpbody) = splitted[:2]
|
(header, httpbody) = splitted[:2]
|
||||||
|
header = header.replace('\r', '')
|
||||||
|
header = header.lstrip('\n')
|
||||||
header = header.split('\n')
|
header = header.split('\n')
|
||||||
statusline = header[0].split(' ', 2)
|
statusline = header[0].split(' ', 2)
|
||||||
header = header[1:]
|
header = header[1:]
|
||||||
|
|
Loading…
Reference in New Issue