aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-02 17:39:02 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-08-02 17:39:02 +0200
commit4aa55450a36aaab09228e0e078218262f8fe73a4 (patch)
treedb3823f7236a45e57f19c873775218891317e380 /tests
parent8a8c47aaba37865a3696e3ffd4d96c8aa3b70be8 (diff)
tests: osmo-pcap: cleanup for osmux test receiver loop
Diffstat (limited to 'tests')
-rw-r--r--tests/osmo-pcap-test/osmux_test.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/osmo-pcap-test/osmux_test.c b/tests/osmo-pcap-test/osmux_test.c
index 35a986b..e741a9a 100644
--- a/tests/osmo-pcap-test/osmux_test.c
+++ b/tests/osmo-pcap-test/osmux_test.c
@@ -84,18 +84,14 @@ struct osmux_in_handle h_input = {
static int pcap_test_run(struct msgb *msg)
{
int ret;
-retry:
- ret = osmux_xfrm_input(msg);
- switch(ret) {
- case -1:
- printf("something is wrong\n");
- break;
- case 0:
- break;
- case 1:
- osmux_xfrm_input_deliver(&h_input);
- goto retry;
+
+ while ((ret = osmux_xfrm_input(msg)) > 1) {
+ /* batch full, deliver it */
+ osmux_xfrm_input_deliver(&h_input);
}
+ if (ret == -1)
+ printf("something is wrong\n");
+
return 0;
}