From e35ff2b844e30196d4eb7c0693e5eaf214dfcbbb Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 2 Apr 2008 09:10:53 +0100 Subject: [PATCH] blast: Fix segfault for immediate connection. This manifests itself when run under noip, which uses Unix-domain sockets instead. The problem is to do with the timer, which isn't active at the the that conn_init is called. --- blast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blast.c b/blast.c index 597263e..60ef0f7 100644 --- a/blast.c +++ b/blast.c @@ -112,13 +112,14 @@ static void newconn(blast *b) goto fail; gettimeofday(&tv, 0); TV_ADD(&tv, &tv, &ctv); + sel_addtimer(&sel, &b->t, &tv, timeout, b); if (conn_init(&b->c, &sel, fd, (struct sockaddr *)&sin, sizeof(sin), connected, b)) goto fail; - sel_addtimer(&sel, &b->t, &tv, timeout, b); return; fail: + sel_rmtimer(&b->t); backoff(b); } -- 2.11.0