libmicrohttpd-http2 icon indicating copy to clipboard operation
libmicrohttpd-http2 copied to clipboard

Handling of requests over multiplexed streams

Open SharmaShikha-84 opened this issue 6 years ago • 4 comments

Hello,

On receiving multiple requests over streams , the library processes stream one by one and expects the response back from the first stream before moving to process another one. Scenario : Request 1 (over Stream 3), Request 2(over Stream 5) & Request 2(over Stream 9.)

  • Application handler called from on_frame_recv_cb for Request 1-Stream3.
  • Introduced delay in application for 5 secs in the handler.
  • Request 2(over Stream 5) is processed only after 5 sec have passed and it receives positive/negative response.

At this time if 1 stream is blocked/taking some time, all others are blocked/delayed as well.

SharmaShikha-84 avatar Jul 03 '19 08:07 SharmaShikha-84

Hi @coolshikhs ! Thank you for reporting this bug. This functionality is not implemented yet, but I should do it very soon.

Normally, if you know that the response can take time, you should use MHD_suspend_connection and MHD_resume_connection in your application request handler function.

See this: https://www.gnu.org/software/libmicrohttpd/manual/html_node/microhttpd_002dflow.html https://github.com/maru/libmicrohttpd-http2/blob/master/src/examples/suspend_resume_epoll.c

maru avatar Jul 04 '19 15:07 maru

Hi Maru, Do you have an idea when can we expect this functionality?

Thanks, Shikha

SharmaShikha-84 avatar Jul 15 '19 07:07 SharmaShikha-84

Hi Shikha, sorry for the delay, I haven't had the time to look into it.

If you have an idea, you are more than welcome to propose the code! Let me know!

Best regards, Maru

maru avatar Jul 21 '19 19:07 maru

Hi Maru, Just wanted to check if you have had time to work on this or planning it any time soon? I was trying it myself but running into some memory fragmentation issues. Do let me know if you have something in mind regarding the approach. Regards, Shikha

SharmaShikha-84 avatar Oct 14 '19 08:10 SharmaShikha-84