View Issue Details

IDProjectCategoryView StatusLast Update
0007197libmicrohttpdlibmicrohttpd multi-threaded operationpublic2023-02-08 14:38
Reporterbasch Assigned ToChristian Grothoff  
Status feedbackResolutionopen 
Product Version0.9.75 
Summary0007197: MHD_USE_ITC is disabled w/o MHD_USE_INTERNAL_POLLING_THREAD

I'm using MHD in one thread and let it do all the select()-stuff through MHD_run_wait().

Also, I'm passing MHD_USE_ITC to MHD_start_daemon() because daemon->itc is used in MHD_resume_connection() to immediately wake up the select().

However, in MHD_start_daemon() the MHD_USE_ITC-flag is reset if MHD_USE_INTERNAL_POLLING_THREAD isn't set.

Thanks and keep up the good work,
TagsNo tags attached.


Christian Grothoff

2023-02-08 14:38

manager   ~0019778

I'm a bit confused. MHD_USE_INTERNAL_POLLING_THREAD *must* be set if you use MHD_run_wait():

enum MHD_Result MHD_run_wait (struct MHD_Daemon *daemon, int32_t millisec) {
  if ( (daemon->shutdown) ||
       (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) )
    return MHD_NO;
  // ...

so without that flag, using MHD_run_wait() just won't work! So either you do set that flag, and then the MHD_USE_ITC flag will not be cleared, or you do not use internal polling, but then your event loop will be done by yourself and hence you can do the ITC yourself. What am I not understanding?

Issue History

Date Modified Username Field Change
2022-03-17 21:29 basch New Issue
2023-02-08 14:38 Christian Grothoff Note Added: 0019778
2023-02-08 14:38 Christian Grothoff Assigned To => Christian Grothoff
2023-02-08 14:38 Christian Grothoff Status new => feedback