]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix(c): fix polling for read+write
authorArshia Ghafoori <arshia001@live.com>
Wed, 27 Aug 2025 10:26:01 +0000 (14:26 +0400)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 13 Oct 2025 11:26:01 +0000 (13:26 +0200)
docs/news.rst
psycopg_c/psycopg_c/_psycopg/waiting.pyx

index d859534dc796e1b60b70321f81ab1b2e58f029b5..7c3d6929eca217c2d318b175ca4eb4f2987fa853 100644 (file)
@@ -13,6 +13,7 @@ Future releases
 Psycopg 3.2.11 (unreleased)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+- Fix spurious readiness flags in some of the wait functions (:ticket:`#1141`).
 - Fix bad data on error in binary copy (:ticket:`#1147`).
 - Don't raise warning, and don't leak resources, if a builtin function is used
   as JSON dumper/loader function (:ticket:`#1165`).
index ed04bb47215468162e4efea9237f5339b9631772..625b42d5e65774d71b890afb96f2073a76b41daa 100644 (file)
@@ -88,8 +88,8 @@ retry_eintr:
 
     rv = 0;  /* success, maybe with timeout */
     if (select_rv >= 0) {
-        if (input_fd.events & POLLIN) { rv |= SELECT_EV_READ; }
-        if (input_fd.events & POLLOUT) { rv |= SELECT_EV_WRITE; }
+        if (input_fd.revents & POLLIN) { rv |= SELECT_EV_READ; }
+        if (input_fd.revents & POLLOUT) { rv |= SELECT_EV_WRITE; }
     }
 
 #else