summaryrefslogtreecommitdiff
path: root/lib/examples/client-blocking.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-14 15:20:52 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-14 15:20:52 +0100
commit23744d97b5b8cc8f5fb962bcea4ed0bfdaab351d (patch)
tree062389d53e0faa6d88b92e9499b8a8aed0580a7d /lib/examples/client-blocking.c
parentf45faec5b0d1052ed37295a6d421d70d0b0ff638 (diff)
Verify result in example program. Also, don't leak a package.
Diffstat (limited to 'lib/examples/client-blocking.c')
-rw-r--r--lib/examples/client-blocking.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c
index 8d2b68d..718dc47 100644
--- a/lib/examples/client-blocking.c
+++ b/lib/examples/client-blocking.c
@@ -67,12 +67,20 @@ blocking_client (const char *av1, const char *av2, int use_request_object_flag)
}
if (resp)
- rs_dump_packet (resp);
+ {
+ rs_dump_packet (resp);
+ if (rs_packet_frpkt (resp)->code == PW_AUTHENTICATION_ACK)
+ printf ("Good auth.\n");
+ else
+ printf ("Bad auth: %d\n", rs_packet_frpkt (resp)->code);
+ }
else
fprintf (stderr, "%s: no response\n", __func__);
cleanup:
err = rs_err_conn_pop (conn);
+ if (resp)
+ rs_packet_destroy (resp);
if (request)
rs_request_destroy (request);
if (conn)