aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-11-29 21:52:17 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-11-29 21:52:17 +0100
commit044e9ecdc3ea1775a40b13add07afd15f3565dff (patch)
treedb5a2dd8b28bd43ba7071b072a96511ed26529e4
parentmany improvements, mainly on gg_client (diff)
downloadglouglou-044e9ecdc3ea1775a40b13add07afd15f3565dff.tar.xz
glouglou-044e9ecdc3ea1775a40b13add07afd15f3565dff.zip
use EVLOOP_NONBLOCK in event_base_loop(), as we now deal with timers in
gg_client so we need more event cycles than EVLOOP_ONCE.
-rw-r--r--libglouglou/tests/connect.c4
-rw-r--r--libglouglou/tests/sendrecv.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/libglouglou/tests/connect.c b/libglouglou/tests/connect.c
index b61107f..3e46667 100644
--- a/libglouglou/tests/connect.c
+++ b/libglouglou/tests/connect.c
@@ -34,8 +34,8 @@ main(void)
printf("error: gg_client_connect returned NULL\n");
return 1;
}
- event_base_loop(ev_base, EVLOOP_ONCE);
- event_base_loop(ev_base, EVLOOP_ONCE);
+ event_base_loop(ev_base, EVLOOP_NONBLOCK);
+ event_base_loop(ev_base, EVLOOP_NONBLOCK);
if (srv_connect_ok == 0)
printf("error: srv_connect_ok == 0\n");
diff --git a/libglouglou/tests/sendrecv.c b/libglouglou/tests/sendrecv.c
index d245825..ff848f0 100644
--- a/libglouglou/tests/sendrecv.c
+++ b/libglouglou/tests/sendrecv.c
@@ -42,8 +42,8 @@ main(void)
printf("error: gg_client_connect returned NULL\n");
return 1;
}
- event_base_loop(ev_base, EVLOOP_ONCE);
- event_base_loop(ev_base, EVLOOP_ONCE);
+ event_base_loop(ev_base, EVLOOP_NONBLOCK);
+ event_base_loop(ev_base, EVLOOP_NONBLOCK);
pkt.ver = PACKET_VERSION;
pkt.type = PACKET_NEWCONN;
@@ -59,5 +59,7 @@ main(void)
if (cli_recv_ok == 0)
printf("error: cli_recv_ok == 0\n");
+ gg_client_disconnect(cli);
+
return (!srv_recv_ok || !cli_recv_ok);
}