Remove END_SEGMENT flag
This commit is contained in:
parent
98be65a1eb
commit
b8a2bf2675
|
@ -476,10 +476,6 @@ typedef enum {
|
||||||
* The ACK flag.
|
* The ACK flag.
|
||||||
*/
|
*/
|
||||||
NGHTTP2_FLAG_ACK = 0x01,
|
NGHTTP2_FLAG_ACK = 0x01,
|
||||||
/**
|
|
||||||
* The END_SEGMENT flag.
|
|
||||||
*/
|
|
||||||
NGHTTP2_FLAG_END_SEGMENT = 0x02,
|
|
||||||
/**
|
/**
|
||||||
* The PADDED flag.
|
* The PADDED flag.
|
||||||
*/
|
*/
|
||||||
|
@ -2382,8 +2378,7 @@ int32_t nghttp2_submit_headers(nghttp2_session *session, uint8_t flags,
|
||||||
* Submits one or more DATA frames to the stream |stream_id|. The
|
* Submits one or more DATA frames to the stream |stream_id|. The
|
||||||
* data to be sent are provided by |data_prd|. If |flags| contains
|
* data to be sent are provided by |data_prd|. If |flags| contains
|
||||||
* :enum:`NGHTTP2_FLAG_END_STREAM`, the last DATA frame has END_STREAM
|
* :enum:`NGHTTP2_FLAG_END_STREAM`, the last DATA frame has END_STREAM
|
||||||
* flag set. If |flags| contains :enum:`NGHTTP2_FLAG_END_SEGMENT`,
|
* flag set.
|
||||||
* the last DATA frame has END_SEGMENT flag set.
|
|
||||||
*
|
*
|
||||||
* This function does not take ownership of the |data_prd|. The
|
* This function does not take ownership of the |data_prd|. The
|
||||||
* function copies the members of the |data_prd|.
|
* function copies the members of the |data_prd|.
|
||||||
|
|
|
@ -231,11 +231,10 @@ void nghttp2_frame_data_init(nghttp2_data *frame, nghttp2_private_data *pdata)
|
||||||
{
|
{
|
||||||
frame->hd = pdata->hd;
|
frame->hd = pdata->hd;
|
||||||
frame->padlen = pdata->padlen;
|
frame->padlen = pdata->padlen;
|
||||||
/* flags may have NGHTTP2_FLAG_END_STREAM or
|
/* flags may have NGHTTP2_FLAG_END_STREAM even if the sent chunk is
|
||||||
NGHTTP2_FLAG_END_SEGMENT even if the sent chunk is not the end of
|
not the end of the stream */
|
||||||
the stream */
|
|
||||||
if(!pdata->eof) {
|
if(!pdata->eof) {
|
||||||
frame->hd.flags &= ~(NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_END_SEGMENT);
|
frame->hd.flags &= ~NGHTTP2_FLAG_END_STREAM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4325,7 +4325,6 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
|
||||||
DEBUGF(fprintf(stderr, "recv: DATA\n"));
|
DEBUGF(fprintf(stderr, "recv: DATA\n"));
|
||||||
|
|
||||||
iframe->frame.hd.flags &= (NGHTTP2_FLAG_END_STREAM |
|
iframe->frame.hd.flags &= (NGHTTP2_FLAG_END_STREAM |
|
||||||
NGHTTP2_FLAG_END_SEGMENT |
|
|
||||||
NGHTTP2_FLAG_PADDED);
|
NGHTTP2_FLAG_PADDED);
|
||||||
/* Check stream is open. If it is not open or closing,
|
/* Check stream is open. If it is not open or closing,
|
||||||
ignore payload. */
|
ignore payload. */
|
||||||
|
@ -4369,7 +4368,6 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
|
||||||
DEBUGF(fprintf(stderr, "recv: HEADERS\n"));
|
DEBUGF(fprintf(stderr, "recv: HEADERS\n"));
|
||||||
|
|
||||||
iframe->frame.hd.flags &= (NGHTTP2_FLAG_END_STREAM |
|
iframe->frame.hd.flags &= (NGHTTP2_FLAG_END_STREAM |
|
||||||
NGHTTP2_FLAG_END_SEGMENT |
|
|
||||||
NGHTTP2_FLAG_END_HEADERS |
|
NGHTTP2_FLAG_END_HEADERS |
|
||||||
NGHTTP2_FLAG_PADDED |
|
NGHTTP2_FLAG_PADDED |
|
||||||
NGHTTP2_FLAG_PRIORITY);
|
NGHTTP2_FLAG_PRIORITY);
|
||||||
|
@ -5576,7 +5574,7 @@ int nghttp2_session_pack_data(nghttp2_session *session,
|
||||||
|
|
||||||
/* Clear flags, because this may contain previous flags of previous
|
/* Clear flags, because this may contain previous flags of previous
|
||||||
DATA */
|
DATA */
|
||||||
frame->hd.flags &= (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_END_SEGMENT);
|
frame->hd.flags &= NGHTTP2_FLAG_END_STREAM;
|
||||||
flags = NGHTTP2_FLAG_NONE;
|
flags = NGHTTP2_FLAG_NONE;
|
||||||
|
|
||||||
if(data_flags & NGHTTP2_DATA_FLAG_EOF) {
|
if(data_flags & NGHTTP2_DATA_FLAG_EOF) {
|
||||||
|
@ -5584,9 +5582,6 @@ int nghttp2_session_pack_data(nghttp2_session *session,
|
||||||
if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
|
if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
|
||||||
flags |= NGHTTP2_FLAG_END_STREAM;
|
flags |= NGHTTP2_FLAG_END_STREAM;
|
||||||
}
|
}
|
||||||
if(frame->hd.flags & NGHTTP2_FLAG_END_SEGMENT) {
|
|
||||||
flags |= NGHTTP2_FLAG_END_SEGMENT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The primary reason of data_frame is pass to the user callback */
|
/* The primary reason of data_frame is pass to the user callback */
|
||||||
|
|
|
@ -81,9 +81,7 @@ static int32_t submit_headers_shared
|
||||||
}
|
}
|
||||||
|
|
||||||
flags_copy =
|
flags_copy =
|
||||||
(flags & (NGHTTP2_FLAG_END_STREAM |
|
(flags & (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_PRIORITY)) |
|
||||||
NGHTTP2_FLAG_END_SEGMENT |
|
|
||||||
NGHTTP2_FLAG_PRIORITY)) |
|
|
||||||
NGHTTP2_FLAG_END_HEADERS;
|
NGHTTP2_FLAG_END_HEADERS;
|
||||||
|
|
||||||
if(stream_id == -1) {
|
if(stream_id == -1) {
|
||||||
|
@ -538,8 +536,7 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
nghttp2_private_data *data_frame;
|
nghttp2_private_data *data_frame;
|
||||||
uint8_t nflags = flags & (NGHTTP2_FLAG_END_STREAM |
|
uint8_t nflags = flags & NGHTTP2_FLAG_END_STREAM;
|
||||||
NGHTTP2_FLAG_END_SEGMENT);
|
|
||||||
|
|
||||||
if(stream_id == 0) {
|
if(stream_id == 0) {
|
||||||
return NGHTTP2_ERR_INVALID_ARGUMENT;
|
return NGHTTP2_ERR_INVALID_ARGUMENT;
|
||||||
|
|
|
@ -221,12 +221,6 @@ void print_flags(const nghttp2_frame_hd& hd)
|
||||||
if(hd.flags & NGHTTP2_FLAG_END_STREAM) {
|
if(hd.flags & NGHTTP2_FLAG_END_STREAM) {
|
||||||
s += "END_STREAM";
|
s += "END_STREAM";
|
||||||
}
|
}
|
||||||
if(hd.flags & NGHTTP2_FLAG_END_SEGMENT) {
|
|
||||||
if(!s.empty()) {
|
|
||||||
s += " | ";
|
|
||||||
}
|
|
||||||
s += "END_SEGMENT";
|
|
||||||
}
|
|
||||||
if(hd.flags & NGHTTP2_FLAG_PADDED) {
|
if(hd.flags & NGHTTP2_FLAG_PADDED) {
|
||||||
if(!s.empty()) {
|
if(!s.empty()) {
|
||||||
s += " | ";
|
s += " | ";
|
||||||
|
@ -238,12 +232,6 @@ void print_flags(const nghttp2_frame_hd& hd)
|
||||||
if(hd.flags & NGHTTP2_FLAG_END_STREAM) {
|
if(hd.flags & NGHTTP2_FLAG_END_STREAM) {
|
||||||
s += "END_STREAM";
|
s += "END_STREAM";
|
||||||
}
|
}
|
||||||
if(hd.flags & NGHTTP2_FLAG_END_SEGMENT) {
|
|
||||||
if(!s.empty()) {
|
|
||||||
s += " | ";
|
|
||||||
}
|
|
||||||
s += "END_SEGMENT";
|
|
||||||
}
|
|
||||||
if(hd.flags & NGHTTP2_FLAG_END_HEADERS) {
|
if(hd.flags & NGHTTP2_FLAG_END_HEADERS) {
|
||||||
if(!s.empty()) {
|
if(!s.empty()) {
|
||||||
s += " | ";
|
s += " | ";
|
||||||
|
|
|
@ -2989,8 +2989,7 @@ void test_nghttp2_submit_data(void)
|
||||||
&pri_spec_default, NGHTTP2_STREAM_OPENING,
|
&pri_spec_default, NGHTTP2_STREAM_OPENING,
|
||||||
NULL);
|
NULL);
|
||||||
CU_ASSERT(0 == nghttp2_submit_data(session,
|
CU_ASSERT(0 == nghttp2_submit_data(session,
|
||||||
NGHTTP2_FLAG_END_STREAM |
|
NGHTTP2_FLAG_END_STREAM, 1, &data_prd));
|
||||||
NGHTTP2_FLAG_END_SEGMENT, 1, &data_prd));
|
|
||||||
|
|
||||||
ud.block_count = 0;
|
ud.block_count = 0;
|
||||||
CU_ASSERT(0 == nghttp2_session_send(session));
|
CU_ASSERT(0 == nghttp2_session_send(session));
|
||||||
|
@ -3001,8 +3000,7 @@ void test_nghttp2_submit_data(void)
|
||||||
|
|
||||||
CU_ASSERT(NGHTTP2_FLAG_NONE == hd.flags);
|
CU_ASSERT(NGHTTP2_FLAG_NONE == hd.flags);
|
||||||
/* frame->hd.flags has these flags */
|
/* frame->hd.flags has these flags */
|
||||||
CU_ASSERT((NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_END_SEGMENT) ==
|
CU_ASSERT(NGHTTP2_FLAG_END_STREAM == data_frame->hd.flags);
|
||||||
data_frame->hd.flags);
|
|
||||||
|
|
||||||
nghttp2_session_del(session);
|
nghttp2_session_del(session);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue