Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
facec139
Commit
facec139
authored
15 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
fix receiving long messages in several parts with BOSH. see #5401
parent
bcefe996
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/xmpp/transports_nb.py
+7
-1
7 additions, 1 deletion
src/common/xmpp/transports_nb.py
with
7 additions
and
1 deletion
src/common/xmpp/transports_nb.py
+
7
−
1
View file @
facec139
...
...
@@ -653,7 +653,8 @@ class NonBlockingHTTP(NonBlockingTCP):
# append currently received data to HTTP msg in buffer
self
.
recvbuff
=
'
%s%s
'
%
(
self
.
recvbuff
or
''
,
data
)
statusline
,
headers
,
httpbody
,
self
.
recvbuff
=
self
.
parse_http_message
(
self
.
recvbuff
)
statusline
,
headers
,
httpbody
,
buffer_rest
=
self
.
parse_http_message
(
self
.
recvbuff
)
if
not
(
statusline
and
headers
and
httpbody
):
log
.
debug
(
'
Received incomplete HTTP response
'
)
...
...
@@ -673,6 +674,10 @@ class NonBlockingHTTP(NonBlockingTCP):
log
.
info
(
'
not enough bytes in HTTP response - %d expected, %d got
'
%
(
self
.
expected_length
,
len
(
self
.
recvbuff
)))
else
:
# First part of buffer has been extraced and is going to be handled,
# remove it from buffer
self
.
recvbuff
=
buffer_rest
# everything was received
self
.
expected_length
=
0
...
...
@@ -716,6 +721,7 @@ class NonBlockingHTTP(NonBlockingTCP):
headers - dictionary of headers e.g. {
'
Content-Length
'
:
'
604
'
,
'
Content-Type
'
:
'
text/xml; charset=utf-8
'
},
httpbody - string with http body)
http_rest - what is left in the message after a full HTTP header + body
'''
message
=
message
.
replace
(
'
\r
'
,
''
)
splitted
=
message
.
split
(
'
\n\n
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment