Commit 0c70ff56 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Simplify

parent ba671a84
...@@ -2556,6 +2556,8 @@ static int session_after_frame_sent2(nghttp2_session *session) { ...@@ -2556,6 +2556,8 @@ static int session_after_frame_sent2(nghttp2_session *session) {
nghttp2_bufs *framebufs = &aob->framebufs; nghttp2_bufs *framebufs = &aob->framebufs;
nghttp2_frame *frame; nghttp2_frame *frame;
nghttp2_mem *mem; nghttp2_mem *mem;
nghttp2_stream *stream;
nghttp2_data_aux_data *aux_data;
mem = &session->mem; mem = &session->mem;
frame = &item->frame; frame = &item->frame;
...@@ -2578,50 +2580,46 @@ static int session_after_frame_sent2(nghttp2_session *session) { ...@@ -2578,50 +2580,46 @@ static int session_after_frame_sent2(nghttp2_session *session) {
active_outbound_item_reset(&session->aob, mem); active_outbound_item_reset(&session->aob, mem);
return 0; return 0;
} else { }
nghttp2_stream *stream;
nghttp2_data_aux_data *aux_data;
aux_data = &item->aux_data.data;
/* On EOF, we have already detached data. Please note that /* DATA frame */
application may issue nghttp2_submit_data() in
on_frame_send_callback (call from session_after_frame_sent1),
which attach data to stream. We don't want to detach it. */
if (aux_data->eof) {
active_outbound_item_reset(aob, mem);
return 0; aux_data = &item->aux_data.data;
}
/* Reset no_copy here because next write may not use this. */ /* On EOF, we have already detached data. Please note that
aux_data->no_copy = 0; application may issue nghttp2_submit_data() in
on_frame_send_callback (call from session_after_frame_sent1),
which attach data to stream. We don't want to detach it. */
if (aux_data->eof) {
active_outbound_item_reset(aob, mem);
stream = nghttp2_session_get_stream(session, frame->hd.stream_id); return 0;
}
/* If session is closed or RST_STREAM was queued, we won't send /* Reset no_copy here because next write may not use this. */
further data. */ aux_data->no_copy = 0;
if (nghttp2_session_predicate_data_send(session, stream) != 0) {
if (stream) {
rv = nghttp2_stream_detach_item(stream);
if (nghttp2_is_fatal(rv)) { stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
return rv;
}
}
active_outbound_item_reset(aob, mem); /* If session is closed or RST_STREAM was queued, we won't send
further data. */
if (nghttp2_session_predicate_data_send(session, stream) != 0) {
if (stream) {
rv = nghttp2_stream_detach_item(stream);
return 0; if (nghttp2_is_fatal(rv)) {
return rv;
}
} }
aob->item = NULL; active_outbound_item_reset(aob, mem);
active_outbound_item_reset(&session->aob, mem);
return 0; return 0;
} }
/* Unreachable */
assert(0); aob->item = NULL;
active_outbound_item_reset(&session->aob, mem);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment