Re: libpq SSL with non-blocking sockets

From: Steve Singer <ssinger_pg(at)sympatico(dot)ca>
To: Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq SSL with non-blocking sockets
Date: 2011-07-03 02:08:28
Message-ID: BLU0-SMTP6343F49046496C3DB41A4B8E5D0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 11-06-28 02:14 PM, Martin Pihlak wrote:
> Thanks for the review!
> I have since simplified the patch to assume that partial SSL writes are
> disabled -- according to SSL_write(3) this is the default behaviour.
> Now the SSL retry buffer only holds the data to be retried, the
> remainder is moved to the new outBuffer.

That sounds okay. Does it make sense to add in a check to verify that
SSL didn't send a partial write? I don't know how bad openssl is about
changing default behaviours or if we are concerned about protecting
against someone changing the SSL parameters. My inclination is that
this isn't needed but I'll raise the issue.
> New version of the patch attached.

Otherwise this version of the patch looks good to me.

The only testing I have done is running the test program you sent
earlier on in the thread and verified that the regression tests all
pass. Other than something like your test program I'm not sure how else
this bug can be induced.

Since the original patch was submitted as a WIP patch and this version
wasn't sent until well into the commit fest I am not sure if it
qualifies for a committer during this commitfest or if it needs to wait
until the next one.

> regards,
> Martin

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Kupershmidt 2011-07-03 03:02:14 plpgsql extension install nitpick
Previous Message Craig Ringer 2011-07-03 01:42:52 Re: on Windows fails to remove flex output