pgsql: Simplify waiting logic in reading from / writing to client. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Simplify waiting logic in reading from / writing to client.
Date
Msg-id E1YMMHM-0004JR-2m@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Simplify waiting logic in reading from / writing to client.

The client socket is always in non-blocking mode, and if we actually want
blocking behaviour, we emulate it by sleeping and retrying. But we have
retry loops at different layers for reads and writes, which was confusing.
To simplify, remove all the sleeping and retrying code from the lower
levels, from be_tls_read and secure_raw_read and secure_raw_write, and put
all the logic in secure_read() and secure_write().

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/80788a431e9bff06314a054109fdea66ac538199

Modified Files
--------------
src/backend/libpq/be-secure-openssl.c |   81 +++++--------------
src/backend/libpq/be-secure.c         |  143 +++++++++++++--------------------
src/backend/libpq/pqcomm.c            |    3 +-
src/include/libpq/libpq-be.h          |    4 +-
4 files changed, 79 insertions(+), 152 deletions(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: pg_upgrade: improve checksum mismatch error message
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Simplify the way OpenSSL renegotiation is initiated in server.