Don't call nghttp2_send_data_callback if stream has already closed
This is more inline with other callback function invocations where if stream was closed, they are not invoked.
This commit is contained in:
parent
9eff511c5e
commit
cc03a12b75
|
@ -2914,22 +2914,31 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session,
|
|||
|
||||
return datalen;
|
||||
}
|
||||
case NGHTTP2_OB_SEND_NO_COPY:
|
||||
case NGHTTP2_OB_SEND_NO_COPY: {
|
||||
nghttp2_stream *stream;
|
||||
nghttp2_frame *frame;
|
||||
|
||||
DEBUGF(fprintf(stderr, "send: no copy DATA\n"));
|
||||
|
||||
frame = &aob->item->frame;
|
||||
|
||||
stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
|
||||
if (stream == NULL) {
|
||||
DEBUGF(fprintf(
|
||||
stderr,
|
||||
"send: no copy DATA cancelled because stream was closed\n"));
|
||||
|
||||
active_outbound_item_reset(aob, mem);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
rv = session_call_send_data(session, aob->item, framebufs);
|
||||
if (nghttp2_is_fatal(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
|
||||
nghttp2_stream *stream;
|
||||
nghttp2_frame *frame;
|
||||
|
||||
frame = &aob->item->frame;
|
||||
|
||||
stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
|
||||
if (stream) {
|
||||
rv = nghttp2_stream_detach_item(stream, session);
|
||||
|
||||
if (nghttp2_is_fatal(rv)) {
|
||||
|
@ -2941,7 +2950,6 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session,
|
|||
if (nghttp2_is_fatal(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
active_outbound_item_reset(aob, mem);
|
||||
|
||||
|
@ -2971,6 +2979,7 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ssize_t nghttp2_session_mem_send(nghttp2_session *session,
|
||||
const uint8_t **data_ptr) {
|
||||
|
|
Loading…
Reference in New Issue