Le Tue, Mar 04, 2008 at 09:18:42AM +0300, Donghui Wen ecrivait :
> You can use evhttp_connection_set_closecb to set up the callback.

  Hello,
  
  The callback set with evhttp_connection_set_closecb() is not called before
you pushed up some reply.

  I'm working on a bosh-like XMPP/HTTP proxy and the issue is this scenario:
  
- Client connects through HTTP, this creates a new evhttp_connection

- the callback for the URI sets up a new connection to the XMPP server, but
does not reply anything to the HTTP request yet

- back to the libevent event loop

- now, the HTTP client drops the connection => no callback is called.



  On the other hand, that scenario perfectly works:
  
- Client connects through HTTP, this creates a new evhttp connection

- sooner or later, evhttp_send_reply() is called to push the reply

- once the reply has been sent, the callback set with
evhttp_connection_set_closecb() is fired as expected.
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to