Return http::error::end_of_stream on HTTP read eof (API Change)

fix #350
This commit is contained in:
Vinnie Falco committed 2017-07-20 08:12:16 -07:00
1 parent 463d891e5c
commit 0656c5b1f5
5 files changed
+62 -4

No files matched your search

+5 -2
View File
@@ -185,8 +185,11 @@ operator()(error_code ec,
BOOST_ASSERT(bytes_transferred == 0);
d.bytes_used = 0;
if(! d.p.got_some())
{
ec = error::end_of_stream;
goto upcall;
// caller sees EOF on next read.
}
// caller sees end_of_stream on next read.
ec = {};
d.p.write_eof(ec);
if(ec)
@@ -194,7 +197,7 @@ operator()(error_code ec,
BOOST_ASSERT(d.p.is_complete());
goto upcall;
}
else if(ec)
if(ec)
{
d.bytes_used = 0;
goto upcall;
+2
View File
@@ -76,7 +76,9 @@ read_some_buffer(
if(ec)
return 0;
BOOST_ASSERT(parser.is_complete());
break;
}
ec = error::end_of_stream;
break;
}
else if(ec)
+45
View File
@@ -41,6 +41,11 @@ namespace http {
being parsed. This additional data is stored in the dynamic
buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept.
@@ -92,6 +97,11 @@ read_some(
being parsed. This additional data is stored in the dynamic
buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept.
@@ -151,6 +161,11 @@ read_some(
processed from the dynamic buffer. The caller should remove
these bytes by calling `consume` on the dynamic buffer.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b AsyncReadStream concept.
@@ -205,6 +220,11 @@ async_read_some(
being parsed. This additional data is stored in the dynamic
buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept.
@@ -244,6 +264,11 @@ read(
being parsed. This additional data is stored in the dynamic
buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b SyncReadStream concept.
@@ -287,6 +312,11 @@ read(
end of the object being parsed. This additional data is stored
in the stream buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b AsyncReadStream concept.
@@ -338,6 +368,11 @@ async_read(
being parsed. This additional data is stored in the dynamic
buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b `SyncReadStream` concept.
@@ -379,6 +414,11 @@ read(
being parsed. This additional data is stored in the dynamic
buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream from which the data is to be read.
The type must support the @b `SyncReadStream` concept.
@@ -424,6 +464,11 @@ read(
end of the message being parsed. This additional data is stored
in the dynamic buffer, which may be used in subsequent calls.
If the end of the stream is reached during the read, the
value @ref error::partial_message is indicated as the
error if bytes have been processed, else the error
@ref error::end_of_stream is indicated.
@param stream The stream to read the message from.
The type must support the @b `AsyncReadStream` concept.