ganeshmurthy commented on a change in pull request #1301:
URL: https://github.com/apache/qpid-dispatch/pull/1301#discussion_r673609267
##########
File path: src/adaptors/http2/http2_adaptor.c
##########
@@ -493,43 +559,32 @@ static int on_data_chunk_recv_callback(nghttp2_session
*session,
// We want to be able to keep collecting the incoming DATA in the message
object so we can ultimately route it when the credit does ultimately arrive.
//
if (stream_data->in_dlv || stream_data->header_and_props_composed) {
- if (!stream_data->stream_force_closed) {
- // DISPATCH-1868: Part of the HTTP2 message body arrives *before*
we can route the delivery. So we accumulated that body
- // in the stream_data->body (in the else part). But before the
rest of the HTTP2 data arrives, we got credit to send the delivery
- // and we have an in_dlv object now. Now, we take the buffers that
were added previously to stream_data->body and call
qd_message_stream_data_append
- if (stream_data->body) {
- if (!stream_data->body_data_added) {
- qd_buffer_list_t existing_buffers;
- DEQ_INIT(existing_buffers);
- qd_compose_take_buffers(stream_data->body,
&existing_buffers);
- // @TODO(kgiusti): handle Q2 block event:
- qd_message_stream_data_append(stream_data->message,
&existing_buffers, 0);
- stream_data->body_data_added = true;
- }
- }
- else {
- // Add a dummy body so that other code that checks for the
presense of stream_data->body will be satisfied.
- // This dummy body field will be be used and will not be sent.
- stream_data->body = qd_compose(QD_PERFORMATIVE_BODY_DATA, 0);
- stream_data->body_data_added = true;
- }
- // @TODO(kgiusti): handle Q2 block event:
- qd_message_stream_data_append(stream_data->message, &buffers, 0);
- qd_log(http2_adaptor->protocol_log_source, QD_LOG_TRACE,
"[C%"PRIu64"][S%"PRId32"] HTTP2 DATA on_data_chunk_recv_callback
qd_compose_insert_binary_buffers into stream_data->message", conn->conn_id,
stream_id);
- }
- else {
- qd_buffer_list_free_buffers(&buffers);
- }
+ qd_buffer_list_t buffers;
+ DEQ_INIT(buffers);
+ qd_buffer_list_append(&buffers, (uint8_t *)data, len);
+ // DISPATCH-1868: Part of the HTTP2 message body arrives
*before* we can route the delivery. So we accumulated the body buffers
+ // in the stream_data->body_buffers. But before the rest of the
HTTP2 data arrives, we got credit to send the delivery
+ // and we have an in_dlv object now. Now, we take the buffers
that were added previously to stream_data->body_buffers and call
qd_message_stream_data_append
+
+ if (DEQ_SIZE(stream_data->body_buffers) > 0) {
Review comment:
This is an issue with my editor which chuck pointed out this morning.
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]