diff options
author | Linus Nordberg <linus@nordu.net> | 2010-10-11 19:06:06 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2010-10-11 19:06:06 +0200 |
commit | e06796fe52596f417d74b3c3758ff0a321f67274 (patch) | |
tree | e79094450d53fe48de78f3f6efe7e3a9a9f6add2 /lib/examples/client-blocking.c | |
parent | 887a170a35bb083fbe4cc6b7315bb15676b99e9f (diff) | |
parent | 06936d1f263c456017e20ea6c74d2756e1e30fcc (diff) |
Merge branch 'merge-luke' into libradsec
8a676ab Robustness fixes (and some callback invocation) by Luke Howard.
ff55882 Request object implementation and bug fixes by Luke Howard.
06936d1 Have rad_decode() verify responses.
Diffstat (limited to 'lib/examples/client-blocking.c')
-rw-r--r-- | lib/examples/client-blocking.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c index bb9e653..365b3b0 100644 --- a/lib/examples/client-blocking.c +++ b/lib/examples/client-blocking.c @@ -55,17 +55,23 @@ blocking_client (const char *av1, const char *av2) #if !defined(USE_REQUEST_OBJECT) if (rs_packet_send (req, NULL)) - return rs_err_conn_pop (conn); - req = NULL; - if (rs_conn_receive_packet (conn, &resp)) - return rs_err_conn_pop (conn); + { + rs_packet_destroy (req); + return rs_err_conn_pop (conn); + } + if (rs_conn_receive_packet (conn, req, &resp)) + { + rs_packet_destroy (req); + return rs_err_conn_pop (conn); + } + rs_packet_destroy (req); #else { struct rs_request *request; - if (rs_request_new (conn, &request)) + if (rs_request_create (conn, &request)) return rs_err_conn_pop (conn); - if (rs_req_send (request, req, &resp)) + if (rs_request_send (request, req, &resp)) return rs_err_conn_pop (conn); rs_request_destroy (request); } |