chiark
/
gitweb
/
~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 1.3.9.
[fwd]
/
blast.c
diff --git
a/blast.c
b/blast.c
index 2791cb1f98ed8dcad51f1e90d6adede60d3623d3..cda534658a6fb6df1661ad0ab1d1459a0ef90068 100644
(file)
--- a/
blast.c
+++ b/
blast.c
@@
-16,6
+16,7
@@
#include <mLib/alloc.h>
#include <mLib/conn.h>
#include <mLib/alloc.h>
#include <mLib/conn.h>
+#include <mLib/macros.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
@@
-34,7
+35,7
@@
static struct timeval ctv = { 0, 500000 };
static sel_timer sec;
static unsigned count = 0;
static sel_timer sec;
static unsigned count = 0;
-static void timers(void);
+static void
IGNORABLE
timers(void);
static void stats(struct timeval *tv, void *p)
{
static void stats(struct timeval *tv, void *p)
{
@@
-103,7
+104,7
@@
static void timers(void)
}
puts("");
}
}
puts("");
}
-
+
static void newconn(blast *b)
{
int fd = socket(PF_INET, SOCK_STREAM, 0);
static void newconn(blast *b)
{
int fd = socket(PF_INET, SOCK_STREAM, 0);
@@
-112,13
+113,14
@@
static void newconn(blast *b)
goto fail;
gettimeofday(&tv, 0);
TV_ADD(&tv, &tv, &ctv);
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;
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:
return;
fail:
+ sel_rmtimer(&b->t);
backoff(b);
}
backoff(b);
}
@@
-151,7
+153,7
@@
int main(int argc, char *argv[])
argv += optind;
argc -= optind;
if (argc != 2) {
argv += optind;
argc -= optind;
if (argc != 2) {
- pquis(stderr, "Usage: $ [-t
time] [-n count] host port
\n");
+ pquis(stderr, "Usage: $ [-t
TIME] [-n COUNT] HOST PORT
\n");
exit(1);
}
exit(1);
}