Skip to content

Commit f006a79

Browse files
committed
Fixed to pass test
1 parent 38492e8 commit f006a79

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

boost/network/protocol/http/client/connection/async_normal.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ struct http_async_connection
322322
// this can be used as a signaling mechanism for the user to
323323
// determine that the body is now ready for processing, even
324324
// though the callback is already provided.
325-
//this->body_promise.set_value("");
325+
this->body_promise.set_value("");
326326

327327
// The invocation of the callback is synchronous to allow us
328328
// to
@@ -439,7 +439,12 @@ struct http_async_connection
439439
case headers:
440440
this->headers_promise.set_exception(boost::copy_exception(error));
441441
case body:
442-
this->body_promise.set_exception(boost::copy_exception(error));
442+
if (!callback) {
443+
// N.B. if callback is non-null, then body_promise has
444+
// already been set to value "" to indicate body is
445+
// handled by streaming handler so no exception should be set
446+
this->body_promise.set_exception(boost::copy_exception(error));
447+
}
443448
break;
444449
default:
445450
BOOST_ASSERT(false && "Bug, report this to the developers!");

0 commit comments

Comments
 (0)