Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of requests over multiplexed streams #69

Open
SharmaShikha-84 opened this issue Jul 3, 2019 · 4 comments
Open

Handling of requests over multiplexed streams #69

SharmaShikha-84 opened this issue Jul 3, 2019 · 4 comments
Labels
Milestone

Comments

@SharmaShikha-84
Copy link

SharmaShikha-84 commented Jul 3, 2019

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.

@maru
Copy link
Owner

maru commented Jul 4, 2019

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 maru added the bug label Jul 4, 2019
@maru maru added this to the MHD merge milestone Jul 4, 2019
@SharmaShikha-84
Copy link
Author

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

Thanks,
Shikha

@maru
Copy link
Owner

maru commented Jul 21, 2019

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

@SharmaShikha-84
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants