]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
ds: flush_write: check {sock} after calling CODE
authorEric Wong <e@80x24.org>
Mon, 23 Jun 2025 18:51:36 +0000 (18:51 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 Jun 2025 17:34:54 +0000 (17:34 +0000)
commit336a31838e814eb83a08d2b51b4809f0e11ba393
tree9675ecaaf75d6956628b054042fe54cacfd48f7c
parent058acb7676ef45c1be89615368f6bb62608878db
ds: flush_write: check {sock} after calling CODE

A user callback may call ->close and invalidate {sock} or even
replace it, so we must revalidate the {sock} field and break
break out of the loop ASAP to ensure we don't attempt further
operations on an invalid socket.

This really ought to fix the
`BUG: ep_mod GLOB=GLOB(...): no such file or directory' (ENOENT)
errors on EPOLL_CTL_MOD when a client shuts down TLS on us.

Followup-to: f7aaea70 (ds: shutdn_tls_step clobbers {wbuf} early, 2025-06-17)
lib/PublicInbox/DS.pm