Re: Really confusing with SSL_write

2007-03-31 Thread Tommy W
On Saturday 31 March 2007 00:26, David Schwartz wrote: I see, so if I disable PARTIAL_WRITES, will that mean that it will return values as I wrote up there? PARTIAL_WRITES has no effect on the meaning of the return value. It just controls whether or not the internal write logic tries to

RE: Really confusing with SSL_write

2007-03-31 Thread David Schwartz
It's just this I'm having a hard trouble to grasp. Normally with say 'write' I would do // pseudo code while(written len) written += write(fd, my_packet + written, len - written); But because SSL_write handles an internal queue and calls for sending the same argument all the time I

RE: Really confusing with SSL_write

2007-03-31 Thread David Schwartz
So what would be your recommendation? Partial writes or not ? Sane non-blocking implementations pretty much have to enable 'partial writes' and 'enable moving write buffer'. Otherwise the semantics become insane, as you pointed out. It all seems a bit unclear to me still I'm afraid. mostly

RE: Really confusing with SSL_write

2007-03-30 Thread Mark
Hi, I've been trying to figure out (plus testing) how to actually use SSL_write. Call SSL_write with the same parameters until it succeeds. You need to handle WANT_READ and WANT_WRITE return values. Mark __ OpenSSL Project

Re: Really confusing with SSL_write

2007-03-30 Thread Tommy W
Hi, I've been trying to figure out (plus testing) how to actually use SSL_write. Call SSL_write with the same parameters until it succeeds. You need to handle WANT_READ and WANT_WRITE return values. I guess that is clear enough. but does that imply if I call SSL_write(ssl, buffer, len),

RE: Really confusing with SSL_write

2007-03-30 Thread David Schwartz
Call SSL_write with the same parameters until it succeeds. You need to handle WANT_READ and WANT_WRITE return values. I guess that is clear enough. but does that imply if I call SSL_write(ssl, buffer, len), it will ONLY return len or 0 ? I mean if it returns len/2 (sent only half

Re: Really confusing with SSL_write

2007-03-30 Thread Tommy W
On Friday 30 March 2007 22:41, David Schwartz wrote: Call SSL_write with the same parameters until it succeeds. You need to handle WANT_READ and WANT_WRITE return values. I guess that is clear enough. but does that imply if I call SSL_write(ssl, buffer, len), it will ONLY return

RE: Really confusing with SSL_write

2007-03-30 Thread David Schwartz
I see, so if I disable PARTIAL_WRITES, will that mean that it will return values as I wrote up there? PARTIAL_WRITES has no effect on the meaning of the return value. It just controls whether or not the internal write logic tries to continue writing if the underlying write partially completes.

Really confusing with SSL_write

2007-03-29 Thread Tommy W
Hi, I've been trying to figure out (plus testing) how to actually use SSL_write. I write alot of data and have an internal Send Queue in which I keep packets. I try to follow this reasoning: 1) try to write the entire chunk with SSL_write if it returns the same value as 'len' then it