I am currently trying to implement push notifications using libmicrohttpd and MHD_create_response_from_callback returning 0 until an event triggers the push. This seems to work pretty fine except for when the client interrupts the communication, then the cleanup method is not called and thus creates a lot of problems and impossibility to "subscribe" again to the push stream.