Question about ngx_handle_write_event

Eran Kornblau eran.kornblau at kaltura.com
Wed Jul 17 14:35:02 UTC 2019


> 
> Hello!
> 
> On Mon, Jul 01, 2019 at 07:23:11PM +0000, Eran Kornblau wrote:
> 
> > Something is unclear to me regarding the use of this function, the 
> > development guide says - "the functions ngx_handle_read_event(rev, 
> > flags) and ngx_handle_write_event(wev, lowat) must be called after handling an I/O socket notification or calling any I/O functions on that socket"
> > 
> > If my module finished sending all the data it had, and is now waiting 
> > for more data to arrive (on some other socket) does it still have to call ngx_handle_write_event?
> 
> Yes.  In particular, this is required with level-tiggered event methods, such as select and poll, to remove the socket from the event list if it was previously added there.
> 

Thank you, Maxim.

I'm looking at ngx_ssl_ocsp_write_handler, and I see that ngx_handle_write_event is called only when the request is fully sent -
it is not called in case of NGX_AGAIN / partial send. 
Is this a bug, or am I still missing something?

Also, isn't there a need to call ngx_send repeatedly in a loop, if it somehow returns n < size? 
(I see there is such a loop in ngx_linux_sendfile_chain for example)

Thanks again,

Eran


> --
> Maxim Dounin
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmdounin.ru%2F&data=02%7C01%7Ceran.kornblau%40kaltura.com%7Cca0c3fc4e662486d250f08d6ff526888%7C0c503748de3f4e2597e26819d53a42b6%7C0%7C0%7C636977126739804073&sdata=Gw248oHqO6ojiJelD70OYUwQCrjdreGQWU%2BtFcRsMTA%3D&reserved=0
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.nginx.org%2Fmailman%2Flistinfo%2Fnginx-devel&data=02%7C01%7Ceran.kornblau%40kaltura.com%7Cca0c3fc4e662486d250f08d6ff526888%7C0c503748de3f4e2597e26819d53a42b6%7C0%7C0%7C636977126739804073&sdata=Ils4vNfi01%2BW6ciLmOOK%2BniHIQhJoL5%2BjrDua0diycQ%3D&reserved=0
>


More information about the nginx-devel mailing list