]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix the way tcp_send_direct() is used
authorOndřej Surý <ondrej@sury.org>
Wed, 21 Oct 2020 06:56:21 +0000 (08:56 +0200)
committerEvan Hunt <each@isc.org>
Thu, 22 Oct 2020 21:59:01 +0000 (14:59 -0700)
commit5547657bce8400bf3df741df45fcd350e0e82aa4
treec3b8f988c886654cd931ebc4644bcb80b707a1c8
parente0ebd02b9c015808b23c0a2805bf67d573f4e4af
Fix the way tcp_send_direct() is used

There were two problems how tcp_send_direct() was used:

1. The tcp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_tcp_send()), but the isc__nm_async_tcpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_tcp_send(), when the TCP send is already in the right
   netthread, it uses tcp_send_direct() to send the TCP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

(cherry picked from commit 6af08d1ca6a105ee8cb6ead64c4fe34b9154d257)
lib/isc/netmgr/tcp.c