Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
savoirfairelinux
opendht
Commits
833bd069
Unverified
Commit
833bd069
authored
5 years ago
by
Sébastien Blin
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #439 from binarytrails/request_fixes
http: end request on 0 body bytes
parents
c03af5f5
39a186c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/http.cpp
+7
-0
7 additions, 0 deletions
src/http.cpp
with
7 additions
and
0 deletions
src/http.cpp
+
7
−
0
View file @
833bd069
...
@@ -637,6 +637,8 @@ Request::init_parser()
...
@@ -637,6 +637,8 @@ Request::init_parser()
on_body_cb
(
at
,
length
);
on_body_cb
(
at
,
length
);
};
};
cbs_
->
on_message_complete
=
[
this
](){
cbs_
->
on_message_complete
=
[
this
](){
if
(
logger_
)
logger_
->
d
(
"[http:client] [request:%i] response: message complete"
,
id_
);
message_complete_
.
store
(
true
);
message_complete_
.
store
(
true
);
};
};
}
}
...
@@ -913,6 +915,11 @@ Request::handle_response_body(const asio::error_code& ec, const size_t bytes)
...
@@ -913,6 +915,11 @@ Request::handle_response_body(const asio::error_code& ec, const size_t bytes)
if
(
logger_
)
if
(
logger_
)
logger_
->
d
(
"[http:client] [request:%i] response body: %i bytes received"
,
id_
,
bytes
);
logger_
->
d
(
"[http:client] [request:%i] response body: %i bytes received"
,
id_
,
bytes
);
if
(
bytes
==
0
){
terminate
(
asio
::
error
::
eof
);
return
;
}
unsigned
int
content_length
;
unsigned
int
content_length
;
auto
content_length_it
=
response_
.
headers
.
find
(
HTTP_HEADER_CONTENT_LENGTH
);
auto
content_length_it
=
response_
.
headers
.
find
(
HTTP_HEADER_CONTENT_LENGTH
);
...
...
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