qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Conway" <acon...@redhat.com>
Subject Re: Review Request: Python client: use same arguments when re-trying SSL socket read and write
Date Wed, 22 May 2013 14:32:17 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11319/#review20895
-----------------------------------------------------------

Ship it!


Logic looks ok, comments are style only. I can't think of a simpler solution.


/trunk/qpid/python/qpid/messaging/transports.py
<https://reviews.apache.org/r/11319/#comment43022>

    I found the logic hard to follow. It might be clearer if you put these 2 lines in the
try: block so the non-error path is easier to see.



/trunk/qpid/python/qpid/messaging/transports.py
<https://reviews.apache.org/r/11319/#comment43023>

    Same comment as as for send


- Alan Conway


On May 21, 2013, 8:40 p.m., Kenneth Giusti wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/11319/
> -----------------------------------------------------------
> 
> (Updated May 21, 2013, 8:40 p.m.)
> 
> 
> Review request for qpid, Alan Conway and Rafael Schloming.
> 
> 
> Description
> -------
> 
> This is a hack (yes, a _HACK_) to work around the behavior of python's SSL implementation.
> 
> When the SSL socket cannot complete a read() or write() operation without performing
it's opposite (a write() or read() operation), it will throw an SSL_ERROR_WANT_READ/WRITE
exception.  To resume the failed operation, the code must re-invoke the read() or write()
with _exactly_ the same parameters as were passed when the call threw the exception.
> 
> This is due to the underlying OpenSSL implementation requirements.
> 
> Originally, when writing we passed the string buffer that holds output data.  This string
buffer can be appended with new write data between the successive calls to write(), which
will cause the underlying pointer to change.  This fix tracks the original buffer passed to
the failing call, and retries the call using that.
> 
> Originally, each call to recv() would return a new buffer.  This patch introduces a bytearray-based
buffer that can be preserved across a read retry.
> 
> Not 100% enamored by this patch, if anyone has a better approach I'm all ears....
> 
> 
> This addresses bug qpid-4872.
>     https://issues.apache.org/jira/browse/qpid-4872
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/python/qpid/messaging/transports.py 1484491 
> 
> Diff: https://reviews.apache.org/r/11319/diff/
> 
> 
> Testing
> -------
> 
> Reproduced the failure both with and without the patch.  No exceptions thrown with the
patch in place.
> 
> 
> Thanks,
> 
> Kenneth Giusti
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message