diff options
author | Anas Nashif <nashif@intel.com> | 2007-05-04 22:28:38 +0000 |
---|---|---|
committer | Anas Nashif <nashif@intel.com> | 2007-05-04 22:28:38 +0000 |
commit | 23a0079658f810c7d18b7a05fbf210d74cee2b13 (patch) | |
tree | fecdc35caa5afec7dd1ba6c46809196d97b15b08 /src | |
parent | 96c514f19dc504afeafef715447b5e27c00b1ead (diff) | |
download | wsmancli-23a0079658f810c7d18b7a05fbf210d74cee2b13.tar.gz wsmancli-23a0079658f810c7d18b7a05fbf210d74cee2b13.tar.xz wsmancli-23a0079658f810c7d18b7a05fbf210d74cee2b13.zip |
improve client thread safety.
Diffstat (limited to 'src')
-rw-r--r-- | src/wsman-client-options.c | 30 | ||||
-rw-r--r-- | src/wsman-client-options.h | 1 | ||||
-rw-r--r-- | src/wsman.c | 17 |
3 files changed, 45 insertions, 3 deletions
diff --git a/src/wsman-client-options.c b/src/wsman-client-options.c index 26b3b32..efa355b 100644 --- a/src/wsman-client-options.c +++ b/src/wsman-client-options.c @@ -318,11 +318,11 @@ int wsman_read_client_config(dictionary * ini) } return 1; } - +#if 0 void wsman_setup_transport_and_library_options() { // transport options - wsman_transport_set_auth_method(authentication_method); + wsman_transport_set_auth_method(cl, authentication_method); if (proxy) { wsman_transport_set_proxy(proxy); if (proxy_upwd) { @@ -338,6 +338,7 @@ void wsman_setup_transport_and_library_options() // library options wsman_debug_set_level(debug_level); } +#endif const char **wsman_options_get_argv(void) @@ -366,6 +367,11 @@ char *wsman_options_get_cafile(void) return cafile; } +char *wsman_options_get_auth_method(void) +{ + return authentication_method; +} + char *wsman_options_get_server(void) { if (server) @@ -507,3 +513,23 @@ char *wsman_options_get_path(void) { return url_path; } +char *wsman_options_get_proxy(void) +{ + return proxy; +} +char *wsman_options_get_proxy_upwd(void) +{ + return proxy_upwd; +} +char wsman_options_get_no_verify_peer(void) +{ + return no_verify_peer; +} +int wsman_options_get_debug_level(void) +{ + return debug_level; +} +unsigned long wsman_options_get_transport_timeout(void) +{ + return transport_timeout; +} diff --git a/src/wsman-client-options.h b/src/wsman-client-options.h index 4218d2d..e9e1232 100644 --- a/src/wsman-client-options.h +++ b/src/wsman-client-options.h @@ -20,6 +20,7 @@ extern char *wsman_options_get_path(void); extern char *wsman_options_get_username(void); extern char *wsman_options_get_password(void); extern char *wsman_options_get_cafile(void); +extern char *wsman_options_get_authentication_method(void); extern int wsman_options_get_max_elements(void); extern char *wsman_options_get_test_file(void); diff --git a/src/wsman.c b/src/wsman.c index e89d3e0..193b597 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -125,7 +125,6 @@ int main(int argc, char **argv) if (!wsman_parse_options(argc, argv)) { exit(EXIT_FAILURE); } - wsman_setup_transport_and_library_options(); initialize_logging(); // wsman_client_transport_init(NULL); @@ -146,6 +145,22 @@ int main(int argc, char **argv) error("Null Client"); exit(EXIT_FAILURE); } + // transport options + wsman_transport_set_auth_method(cl, wsman_options_get_auth_method()); + if (wsman_options_get_proxy()) { + wsman_transport_set_proxy(cl, wsman_options_get_proxy()); + if (wsman_options_get_proxy_upwd()) { + wsman_transport_set_proxyauth(cl, wsman_options_get_proxy_upwd()); + } + } + if (wsman_options_get_cafile()) { + wsman_transport_set_cafile(cl, wsman_options_get_cafile()); + } + wsman_transport_set_no_verify_peer(cl, wsman_options_get_no_verify_peer()); + wsman_transport_set_timeout(cl, wsman_options_get_transport_timeout()); + + // library options + wsman_debug_set_level(wsman_options_get_debug_level()); /* * Setup Resource URI and Selectors */ |