diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-30 01:35:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-04-30 01:35:18 +0200 |
commit | 8dfdfd4e1be6359dc49a44539699c1383ff2b46a (patch) | |
tree | d158046db532f70f2f51f11f587ad4cbfaaa39db /src/modules | |
parent | 23a798caf6aa70bbff3fcbe9bbdb50d602bd1bb3 (diff) |
http: export information about currently active server strings
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/module-protocol-stub.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/modules/module-protocol-stub.c b/src/modules/module-protocol-stub.c index ce3dcd03..5b351d19 100644 --- a/src/modules/module-protocol-stub.c +++ b/src/modules/module-protocol-stub.c @@ -251,7 +251,7 @@ int pa__init(pa_module*m) { int r; #endif -#if defined(USE_PROTOCOL_NATIVE) +#if defined(USE_PROTOCOL_NATIVE) || defined(USE_PROTOCOL_HTTP) char t[256]; #endif @@ -382,6 +382,24 @@ int pa__init(pa_module*m) { # endif #endif +#if defined(USE_PROTOCOL_HTTP) +#if defined(USE_TCP_SOCKETS) + if (u->socket_server_ipv4) + if (pa_socket_server_get_address(u->socket_server_ipv4, t, sizeof(t))) + pa_http_protocol_add_server_string(u->http_protocol, t); + +#ifdef HAVE_IPV6 + if (u->socket_server_ipv6) + if (pa_socket_server_get_address(u->socket_server_ipv6, t, sizeof(t))) + pa_http_protocol_add_server_string(u->http_protocol, t); +#endif /* HAVE_IPV6 */ +#else /* USE_TCP_SOCKETS */ + if (pa_socket_server_get_address(u->socket_server_unix, t, sizeof(t))) + pa_http_protocol_add_server_string(u->http_protocol, t); + +#endif /* USE_TCP_SOCKETS */ +#endif /* USE_PROTOCOL_HTTP */ + if (ma) pa_modargs_free(ma); @@ -419,6 +437,24 @@ void pa__done(pa_module*m) { } #elif defined(USE_PROTOCOL_HTTP) if (u->http_protocol) { + char t[256]; + +#if defined(USE_TCP_SOCKETS) + if (u->socket_server_ipv4) + if (pa_socket_server_get_address(u->socket_server_ipv4, t, sizeof(t))) + pa_http_protocol_remove_server_string(u->http_protocol, t); + +#ifdef HAVE_IPV6 + if (u->socket_server_ipv6) + if (pa_socket_server_get_address(u->socket_server_ipv6, t, sizeof(t))) + pa_http_protocol_remove_server_string(u->http_protocol, t); +#endif /* HAVE_IPV6 */ +#else /* USE_TCP_SOCKETS */ + if (u->socket_server_unix) + if (pa_socket_server_get_address(u->socket_server_unix, t, sizeof(t))) + pa_http_protocol_remove_server_string(u->http_protocol, t); +#endif /* USE_PROTOCOL_HTTP */ + pa_http_protocol_disconnect(u->http_protocol, u->module); pa_http_protocol_unref(u->http_protocol); } |