]> granicus.if.org Git - postgresql/commit
Use OpenSSL's SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 24 Jul 2011 19:18:12 +0000 (15:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 24 Jul 2011 19:18:12 +0000 (15:18 -0400)
commit551458be3aa32bc8103a814eb15931d42ac024c8
treed701daf22ae7bdcd652aa886f318f76fc8d2f49e
parent201d1b289f6fc4d701689c3b8d63de9abea6d600
Use OpenSSL's SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag.

This disables an entirely unnecessary "sanity check" that causes failures
in nonblocking mode, because OpenSSL complains if we move or compact the
write buffer.  The only actual requirement is that we not modify pending
data once we've attempted to send it, which we don't.  Per testing and
research by Martin Pihlak, though this fix is a lot simpler than his patch.

I put the same change into the backend, although it's less clear whether
it's necessary there.  We do use nonblock mode in some situations in
streaming replication, so seems best to keep the same behavior in the
backend as in libpq.

Back-patch to all supported releases.
src/backend/libpq/be-secure.c
src/interfaces/libpq/fe-secure.c