[
https://issues.apache.org/jira/browse/DISPATCH-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17409688#comment-17409688
]
ASF GitHub Bot commented on DISPATCH-2232:
------------------------------------------
kgiusti commented on a change in pull request #1343:
URL: https://github.com/apache/qpid-dispatch/pull/1343#discussion_r702129006
##########
File path: src/adaptors/http2/http2_adaptor.c
##########
@@ -608,55 +594,72 @@ static int snd_data_callback(nghttp2_session *session,
qdr_http2_connection_t *conn = (qdr_http2_connection_t *)user_data;
qdr_http2_stream_data_t *stream_data = (qdr_http2_stream_data_t
*)source->ptr;
- qd_log(http2_adaptor->protocol_log_source, QD_LOG_TRACE,
"[C%"PRIu64"][S%"PRId32"] snd_data_callback length=%zu", conn->conn_id,
stream_data->stream_id, length);
+ qd_log(http2_adaptor->protocol_log_source, QD_LOG_TRACE,
"[C%"PRIu64"][S%"PRId32"] send_data_callback length=%zu", conn->conn_id,
stream_data->stream_id, length);
int bytes_sent = 0; // This should not include the header length of 9.
bool write_buffs = false;
if (length) {
- write_buffs = true;
- qd_http2_buffer_t *http2_buff = qd_http2_buffer();
- DEQ_INSERT_TAIL(conn->buffs, http2_buff);
- // Insert the framehd of length 9 bytes into the buffer
- memcpy(qd_http2_buffer_cursor(http2_buff), framehd,
HTTP2_DATA_FRAME_HEADER_LENGTH);
- qd_http2_buffer_insert(http2_buff, HTTP2_DATA_FRAME_HEADER_LENGTH);
-
- uint32_t octets_remaining =
qd_iterator_remaining(stream_data->curr_stream_data_iter);
-
- size_t len = MIN(octets_remaining, length);
- int copied = qd_iterator_ncopy(stream_data->curr_stream_data_iter,
qd_http2_buffer_cursor(http2_buff), len);
- assert(copied == len);
- qd_http2_buffer_insert(http2_buff, len);
- octets_remaining -= copied;
- bytes_sent += copied;
- qd_iterator_trim_view(stream_data->curr_stream_data_iter,
octets_remaining);
+ qd_http2_buffer_t *tail_buff =
qd_http2_buffer_list_append(&(conn->buffs), framehd,
HTTP2_DATA_FRAME_HEADER_LENGTH);
+ size_t tail_buff_capacity = qd_http2_buffer_capacity(tail_buff);
+ if (tail_buff_capacity == 0) {
+ tail_buff = qd_http2_buffer();
+ DEQ_INSERT_TAIL(conn->buffs, tail_buff);
+ tail_buff_capacity = qd_http2_buffer_capacity(tail_buff);
+ }
+ size_t bytes_to_write = length;
+ while (bytes_to_write > 0) {
+ uint32_t octets_remaining =
qd_iterator_remaining(stream_data->curr_stream_data_iter);
+ qd_log(http2_adaptor->protocol_log_source, QD_LOG_TRACE,
"[C%"PRIu64"][S%"PRId32"] send_data_callback octets_remaining=%"PRId32",
tail_buff_capacity=%zu, bytes_to_write==%zu", conn->conn_id,
stream_data->stream_id, octets_remaining, tail_buff_capacity, bytes_to_write);
Review comment:
This log can potentially put quite a load on the trace output.
--
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]
> [http2] http response is fragmented across many TCP packets thus increasing
> latency
> -----------------------------------------------------------------------------------
>
> Key: DISPATCH-2232
> URL: https://issues.apache.org/jira/browse/DISPATCH-2232
> Project: Qpid Dispatch
> Issue Type: Bug
> Components: Protocol Adaptors
> Reporter: Ganesh Murthy
> Assignee: Ganesh Murthy
> Priority: Major
>
> To reproduce -
> Install the strest-grpc client and server from
> [https://github.com/BuoyantIO/strest-grpc]
> Run a single request/response direct test between client and server and
> capture the HTTP2 traffic between the client and the server using wireshark.
> - ./strest-grpc client --latencyUnit us --connections 1 --iterations 1
> --address localhost:9000 --totalRequests 1
> Notice that the server responds to the request and the response is all in one
> TCP packet.
>
> Now put a router in-between the client and the server and let the client
> connect to the router and capture wireshark trace.
>
> The router sends back to the client several small TCP packets instead of one
> large TCP packet.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]