From 5b5400f66bb3959dbed81f6f544aa6f392ca18f5 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sat, 12 May 2007 06:23:52 +0000 Subject: [PATCH] permit connection free from callback; from Ben Rigas svn:r354 --- http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/http.c b/http.c index 11b6abcd..20ab4641 100644 --- a/http.c +++ b/http.c @@ -573,12 +573,13 @@ void evhttp_connection_done(struct evhttp_connection *evcon) { struct evhttp_request *req = TAILQ_FIRST(&evcon->requests); - + int con_outgoing = evcon->flags & EVHTTP_CON_OUTGOING; + /* * if this is an incoming connection, we need to leave the request * on the connection, so that we can reply to it. */ - if (evcon->flags & EVHTTP_CON_OUTGOING) { + if (con_outgoing) { int need_close; TAILQ_REMOVE(&evcon->requests, req, next); req->evcon = NULL; @@ -614,7 +615,7 @@ evhttp_connection_done(struct evhttp_connection *evcon) (*req->cb)(req, req->cb_arg); /* if this was an outgoing request, we own and it's done. so free it */ - if (evcon->flags & EVHTTP_CON_OUTGOING) { + if (con_outgoing) { evhttp_request_free(req); } }