You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/02/19 21:43:04 UTC

[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #1047: DISPATCH-1968: Avoid proton calls on closed raw connections

ganeshmurthy commented on a change in pull request #1047:
URL: https://github.com/apache/qpid-dispatch/pull/1047#discussion_r579492430



##########
File path: src/adaptors/tcp_adaptor.c
##########
@@ -231,6 +236,31 @@ static int handle_incoming(qdr_tcp_connection_t *conn)
     return count;
 }
 
+
+static void flush_outgoing_buffs(qdr_tcp_connection_t *conn)
+{
+    // Flush buffers staged for writing to raw conn
+    // and free possible references to stream data objects.
+    if (conn->outgoing_buff_count > 0) {
+        for (size_t i = conn->outgoing_buff_idx;
+            i < conn->outgoing_buff_idx + conn->outgoing_buff_count;
+            ++i) {
+            if (conn->outgoing_buffs[i].context) {
+                qd_message_stream_data_release(
+                    (qd_message_stream_data_t*)conn->outgoing_buffs[i].context);
+            }
+        }
+    }
+    conn->outgoing_buff_count = 0;

Review comment:
       does conn->outgoing_buff_idx need to be reset here as well ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org