test reading fail when use https

wandenberg nginx-forum at nginx.us
Sat Jun 25 18:49:32 MSD 2011


Hi,

I use the function ngx_http_test_reading in the module Nginx Push Stream
Module (https://github.com/wandenberg/nginx-push-stream-module) to know
when the user goes off, but when using https  this function always
return a value on call 
n = recv(c->fd, buf, 1, MSG_PEEK);

Checking what was happening and comparing with others calls on same file
ngx_http_request.c I saw that others calls are done with c->recv instead
of recv .

On the case of https this c->recv points to ngx_ssl_recv, which can sure
detect when user goes off.

I would like to suggest to change the line 
n = recv(c->fd, buf, 1, MSG_PEEK); 
for 
n = c->recv(c, buf, 1);

and 
} else if (n == -1) {
for
} else if ((n == -1) || (n == -2)) {

to other returns on https.

I'm not sure if it has any side effect, and don't know if here is the
best place to do this suggestion, sorry if not.

Regards,
Wandenberg

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,209967,209967#msg-209967




More information about the nginx mailing list