diff options
Diffstat (limited to 'lib/examples')
-rw-r--r-- | lib/examples/Makefile | 4 | ||||
-rw-r--r-- | lib/examples/client-blocking.c | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/examples/Makefile b/lib/examples/Makefile index 4a0ab8f..4802c4b 100644 --- a/lib/examples/Makefile +++ b/lib/examples/Makefile @@ -1,4 +1,6 @@ -SPECIAL = # -DUSE_REQUEST_OBJECT +SPECIAL = +#SPECIAL += -DUSE_REQUEST_OBJECT +#SPECIAL += -DUSE_CONFIG_FILE CFLAGS = -Wall -g -I ../include $(SPECIAL) diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c index a9a4f32..0e6ad39 100644 --- a/lib/examples/client-blocking.c +++ b/lib/examples/client-blocking.c @@ -28,10 +28,11 @@ blocking_client (const char *av1, const char *av2) if (rs_context_create (&h, "/usr/share/freeradius/dictionary")) return NULL; - if (rs_conn_create (h, &conn, RS_CONN_TYPE_UDP)) - return rs_err_conn_pop (conn); #if !defined (USE_CONFIG_FILE) - if (rs_server_create (conn, &server, NULL)) + if (rs_conn_create (h, &conn, NULL)) + return rs_err_conn_pop (conn); + rs_conn_set_type (conn, RS_CONN_TYPE_UDP); + if (rs_server_create (conn, &server)) return rs_err_conn_pop (conn); if (rs_server_set_address (server, av1, atoi (av2))) return rs_err_conn_pop (conn); @@ -42,7 +43,7 @@ blocking_client (const char *av1, const char *av2) #else if (rs_context_config_read (h, av1)) return rs_err_ctx_pop (h); - if (rs_server_create (conn, &server, av2)) + if (rs_conn_create (h, &conn, av2)) return rs_err_conn_pop (conn); #endif /* USE_CONFIG_FILE */ |