Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit060e1d4

Browse files
committed
Merge branch '0.9-devel' ofhttps://github.com/omalashenko/cpp-netlib into omalashenko-0.9-devel
2 parentsec91e0a +5ac2d4d commit060e1d4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎boost/network/protocol/http/server/async_connection.hpp‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ namespace boost { namespace network { namespace http {
291291
Handler & handler;
292292
utils::thread_pool & thread_pool_;
293293
volatilebool headers_already_sent, first_line_already_sent, headers_in_progress, first_line_in_progress;
294-
asio::streambuf headers_buffer;
294+
asio::streambuf headers_buffer, first_line_buffer;
295295

296296
boost::recursive_mutex headers_mutex;
297297
buffer_type read_buffer_;
@@ -402,6 +402,7 @@ namespace boost { namespace network { namespace http {
402402
request_.http_version_major = fusion::get<0>(version_pair);
403403
request_.http_version_minor = fusion::get<1>(version_pair);
404404
new_start =boost::end(result_range);
405+
partial_parsed.clear();
405406
}else {
406407
partial_parsed.append(
407408
boost::begin(result_range),
@@ -423,7 +424,6 @@ namespace boost { namespace network { namespace http {
423424
partial_parsed.append(
424425
boost::begin(result_range),
425426
boost::end(result_range));
426-
trim(partial_parsed);
427427
parse_headers(partial_parsed, request_.headers);
428428
new_start =boost::end(result_range);
429429
thread_pool().post(
@@ -503,19 +503,18 @@ namespace boost { namespace network { namespace http {
503503
if (first_line_in_progress)return;
504504
first_line_in_progress =true;
505505

506-
std::vector<asio::const_buffer> buffers;
507506
typedef constants<Tag> consts;
508-
typename ostringstream<Tag>::type first_line_stream;
509-
first_line_stream
507+
first_line_buffer.consume(first_line_buffer.size());
508+
std::ostreamfirst_line_stream(&first_line_buffer);
509+
first_line_stream
510510
<<consts::http_slash() <<1<<consts::dot() <<1 <<consts::space()
511511
<< status <<consts::space() <<status_message(status)
512512
<<consts::crlf()
513+
<< std::flush
513514
;
514-
std::string first_line = first_line_stream.str();
515-
buffers.push_back(asio::buffer(first_line));
516515
asio::async_write(
517516
socket()
518-
,buffers
517+
,first_line_buffer
519518
, callback);
520519
}
521520

‎libs/network/src/server_request_parsers_impl.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ namespace boost { namespace network { namespace http {
3131
*(
3232
+(alnum|(punct-':'))
3333
>>lit(":")
34-
>> +(alnum|space|punct)
34+
>> +((alnum|space|punct) -'\r' -'\n')
3535
>>lit("\r\n")
3636
)
37+
>>lit("\r\n")
3738
, container
3839
);
3940
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp