pool_t pool;
unsigned int refcount;
const char *label;
+ unsigned int id;
struct http_client_request *prev, *next;
http_client_request_label(struct http_client_request *req)
{
if (req->label == NULL) {
- return t_strdup_printf("[%s %s%s]",
+ return t_strdup_printf("[Req%u: %s %s%s]", req->id,
req->method, http_url_create(&req->origin_url), req->target);
}
return req->label;
http_client_request_new(struct http_client *client, const char *method,
http_client_request_callback_t *callback, void *context)
{
+ static unsigned int id_counter = 0;
pool_t pool;
struct http_client_request *req;
req->pool = pool;
req->refcount = 1;
req->client = client;
+ req->id = ++id_counter;
req->method = p_strdup(pool, method);
req->callback = callback;
req->context = context;
req->authority = p_strdup(req->pool, authority);
/* debug label */
- req->label = p_strdup_printf(req->pool, "[%s %s]", req->method, target);
+ req->label = p_strdup_printf(req->pool, "[Req%u: %s %s]", req->id, req->method, target);
/* update request target */
if (req->connect_tunnel || have_proxy)