Skip to content

Commit 3cbd21c

Browse files
Valtteri Heikkilastgates
authored andcommitted
Fixed Linux server bug where connection::do_response() was called incorrectly without bad_request=true. Removed do_response() default parameter to avoid this issue in the future.
1 parent 14fd9bd commit 3cbd21c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Release/include/cpprest/http_linux_server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class connection
8787
void handle_chunked_body(const boost::system::error_code& ec, int toWrite);
8888
void dispatch_request_to_listener();
8989
void request_data_avail(size_t size);
90-
void do_response(bool bad_request=false);
90+
void do_response(bool bad_request);
9191
template <typename ReadHandler>
9292
void async_read_until_buffersize(size_t size, ReadHandler handler);
9393
void async_process_response(http_response response);

Release/src/http/listener/http_linux_server.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void connection::handle_http_line(const boost::system::error_code& ec)
123123
else
124124
{
125125
m_request.reply(status_codes::BadRequest);
126-
do_response();
126+
do_response(true);
127127
}
128128
}
129129
else
@@ -389,12 +389,12 @@ void connection::dispatch_request_to_listener()
389389
if (pListener == nullptr)
390390
{
391391
m_request.reply(status_codes::NotFound);
392-
do_response();
392+
do_response(false);
393393
}
394394
else
395395
{
396396
m_request._set_listener_path(pListener->uri().path());
397-
do_response();
397+
do_response(false);
398398

399399
// Look up the lock for the http_listener.
400400
pplx::extensibility::reader_writer_lock_t *pListenerLock;

0 commit comments

Comments
 (0)