Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bitly patches for libevent-1.4.14b
diff -urp libevent-1.4.14b-stable/configure libevent-1.4.14b-stable-fix/configure
--- libevent-1.4.14b-stable/configure 2010-06-20 09:06:18.000000000 -0400
+++ libevent-1.4.14b-stable-fix/configure 2012-05-09 15:14:09.000000000 -0400
@@ -2988,7 +2988,7 @@ fi
# Define the identity of the package.
PACKAGE=libevent
- VERSION=1.4.14b-stable
+ VERSION=1.4.14b-bitly2
cat >>confdefs.h <<_ACEOF
diff -urp libevent-1.4.14b-stable/http.c libevent-1.4.14b-stable-fix/http.c
--- cb-libevent-1.4.14b-stable/http.c 2014-05-02 16:44:52.000000000 -0400
+++ cb-libevent-1.4.14b-stable-fix/http.c 2014-05-02 16:45:32.000000000 -0400
@@ -687,9 +687,13 @@
evhttp_write(int fd, short what, void *arg)
{
struct evhttp_connection *evcon = arg;
+ struct evhttp_request *req = TAILQ_FIRST(&evcon->requests);
int n;
if (what == EV_TIMEOUT) {
+ if (req != NULL) {
+ req->userdone = 1;
+ }
evhttp_connection_fail(evcon, EVCON_HTTP_TIMEOUT);
return;
}
@@ -927,6 +931,7 @@
int n, len;
if (what == EV_TIMEOUT) {
+ req->userdone = 1;
evhttp_connection_fail(evcon, EVCON_HTTP_TIMEOUT);
return;
}
@@ -2231,6 +2236,7 @@
if (req->uri == NULL) {
event_debug(("%s: bad request", __func__));
if (req->evcon->state == EVCON_DISCONNECTED) {
+ req->userdone = 1;
evhttp_connection_fail(req->evcon, EVCON_HTTP_EOF);
} else {
event_debug(("%s: sending error", __func__));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.