On Thu, Apr 15, 2010 at 4:44 PM, Ron Combs <[email protected]> wrote:
> Hello,
>
> What is the best way to set millisecond timeout to a evhttp_connection using
> the evhttp framework?

Looks like the best long-term solution is to write a patch to add
support for having http timeouts as struct timeval rather than as int.
 You'd need to add new functions to take the place of
evhttp_set_timeout() and evhttp_connection_set_timeout(); I'd suggest
calling them evhttp_[connection_]set_timeout_tv() .

The feature freeze for Libevent 2.0 is the end of April, but this
shouldn't be too hard to do.

> I tried evcon->ev.ev_timeout = tv but its giving me error: dereferencing
> pointer to incomplete type

Well, evhttp_connection isn't a public type; the definition in
http-internal.h isn't meant to be messed with outside libevent.

Even if the definition of evhttp_connection were exposed, altering its
events by hand would be a pretty bad idea.  It's not safe to modify an
event that might be added, and it's a bad idea to use a means other
than event_assign to do so.

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to [email protected] with
unsubscribe libevent-users    in the body.

Reply via email to