[Prev][Next][Index][Thread]

[Q] Request* in HTEvent_registerTimeout ?




Hi,

I need to register a timeout function. What is the request* for in

PUBLIC BOOL HTEvent_registerTimeout (struct timeval *tp, HTRequest * request,
                                     HTEventTimeout *tcbf, BOOL always)

?

I can't think why you need to register a request. Surely the idea
is that when a timeout occurs, it calls tcbf with the request that
timed out? From what I can gather looking at the code:

        /* If timeout then see if we should call callback function */
        if (active_sockets == 0) {
            if (seltime.tcbf && (seltime.always || !HTNet_idle())) {
                if ((status = (*(seltime.tcbf))(seltime.request)) != HT_OK)
                    return status;
            } else
                continue;
        }

- it seems to call the callback function with the request you
registered. Does this mean that you can only register a timeout for
one request at a time? Or does seltime.request get reset in the
meantime if another request becomes the active one?

Any clues much appreciated,

Sacha.