Welcome! Log In Create A New Profile

Advanced

Re: ngx_unix_recv problem

Maxim Dounin
August 27, 2009 05:12AM
Hello!

On Thu, Aug 27, 2009 at 04:47:05AM -0400, wangbin579 wrote:

> the http request:
> wget -O /tmp/re -S "http://***/setcookie" --post-data='username=liufeng&loginCookie=ayaheiheifn&domain=xxx.com'
> the http request sends two packets,and ngx_unix_recv is called two times.
> the first call does work properly,
> but the secend call fails:the call to recv returns -1.
> if the program sleeps for some time before recv call ,the system works properly.
> who can tell me how to solve this problem

First of all - do not use ngx_unix_recv() directly, use ngx_recv()
instead.

Second, is it really returns -1? From your description it looks
like it returns -2 (NGX_AGAIN) which you have to be prepared to
handle correctly (by calling it again as soon as something happens
on socket in question).

If it really returns -1 (NGX_ERROR) - it should log the reason via
ngx_connection_error() at appropriate logging level.

Maxim Dounin
Subject Author Posted

ngx_unix_recv problem

wangbin579 August 27, 2009 04:47AM

Re: ngx_unix_recv problem

wangbin579 August 27, 2009 05:10AM

Re: ngx_unix_recv problem

Maxim Dounin August 27, 2009 05:17AM

Re: ngx_unix_recv problem

Maxim Dounin August 27, 2009 05:12AM

Re: ngx_unix_recv problem

wangbin579 August 27, 2009 11:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready