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-31 Thread Tommy W
On Saturday 31 March 2007 13:30, David Schwartz wrote: > > 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 handl

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 t

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

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

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 wil

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 on

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, buffe

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 Projec