Cool. Thanks a lot, Maxim.by NginxNewbee - Nginx Mailing List - English
Hey Maxim, Should other nginx methods like ngx_http_output_filter and ngx_http_finalize_request be used on main thread as well ? I am using ngx_http_finalize_request in the thread's completion handler already. However I was wondering if our business logic (running on thread) needs to send response body multiple times as soon as it is generates it, in that case ngx_http_output_filter will need bby NginxNewbee - Nginx Mailing List - English
Maxim - Thank you so much ! Much appreciated.by NginxNewbee - Nginx Mailing List - English
Hey Maxim, can you please find some time to respond to my last question. We read nginx code as well on git hub but confusion remains. We would really appreciate your help on it. Thanks !by NginxNewbee - Nginx Mailing List - English
Thanks. Your understanding is correct. For cases, when ngx_http_read_client_request_body returns NGX_AGAIN, thread returns and request will get finalized. I'll go ahead and move reading contents of r and request body to main thread in the content handler and just keep execution of our business logic on thread. Just one more question - Once I move ngx_http_read_client_request_body in content haby NginxNewbee - Nginx Mailing List - English
Thanks for your comments, Maxim. I truly appreciate it. For first comment, the reason I chose to do request processing on thread is so it wouldn't block nginx. We launch one thread per request (from content handler). There will never will be multiple threads working on a request. r is passed onto a thread callback. Inside that callback, we extract headers, request body etc. from r and store itby NginxNewbee - Nginx Mailing List - English
I think i was finally able to figure this out and wrote my solution here. Hope this helps. https://stackoverflow.com/questions/55908530/how-to-make-nginx-wait-for-a-thread-pool-task-in-http-content-phaseby NginxNewbee - Other discussion
Apologies if this is a trivial question. I have searched it on web and none of the answers have solved my problem. I am trying to read request body and thing seem to work fine if request body is small (4 kb). As soon as it becomes 4+ megabytes,ngx_http_read_client_request_body returns NGX_AGAIN (-2) in rc and my RequestBodyHandler is never called. snippet of nginx.conf is like this for bufferby NginxNewbee - Nginx Mailing List - English
Hello everyone ! Nginx newbie here. I am actually writing a module that will handle the my http request. For this, I added a location content handler (or location directive handler) in my module. My content handler interfaces with a library which is not asynchronous. So within handler, I queue up a task to nginx thread pool. I also added a thread completion handler. The problem I am running into iby NginxNewbee - Other discussion