On Thu, 2014-05-29 at 07:09 -0700, David Moreno Montero wrote:
> In src/onion/response.c:
> 
> > @@ -383,22 +383,23 @@ int onion_response_flush(onion_response *res){
> >  	ONION_DEBUG0("Flush %d bytes", res->buffer_pos);
> >  
> >  	onion_request *req=res->request;
> > -	ssize_t (*write)(onion_request *, const char *data, size_t len);
> > -	write=req->connection.listen_point->write;
> > -	
> > +	ssize_t (*writereqf)(onion_request *, const char *data, size_t len);
> > +	writereqf=req->connection.listen_point->write;
> > +	if (!writereqf)
> > +	  ONION_ERROR("corrupted listen point, null write");
> 
> If there is an error, it should return, no continue.


At least, it enabled me to detect corruption (prematurely freed
request...)

Thanks
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***