]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Prevent an underflow of the TCP d_queued counter 12365/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 27 Dec 2022 16:01:55 +0000 (17:01 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 27 Dec 2022 16:03:44 +0000 (17:03 +0100)
commit817901ff3cee433ef5febdfc19ff29487b94fdd8
tree4d5c732b63b2ccd6d1db3465876aae83a9492680
parent9d16c91bab000fc708fc7e627b797eed6379f973
dnsdist: Prevent an underflow of the TCP d_queued counter

By incrementing it _before_ writing to the pipe, and decrementing
it in case of an error, we prevent a very possible underflow from
occurring if the reader manages to decrement before we can return
from write and increment it.
pdns/dnsdistdist/dnsdist-tcp.hh