diff options
author | Jussi Kukkonen <jussi.kukkonen@intel.com> | 2013-11-04 13:10:41 +0200 |
---|---|---|
committer | Jussi Kukkonen <jku@goto.fi> | 2014-07-07 17:17:47 +0300 |
commit | 83a2150b05f0ae4cb4fef3792a845989045c52eb (patch) | |
tree | a7f494436e55cb63893dfd97ed6739572dcfc23a | |
parent | c6cc55565a767e9bc63896aaa355ef8c79fb3f88 (diff) | |
download | dleyna-renderer-83a2150b05f0ae4cb4fef3792a845989045c52eb.tar.gz |
host-service: use push-host-port setting for the web server
The push-host-port configuration value will be used for the webservers
used to implement the Push Host functionality.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-rw-r--r-- | libdleyna/renderer/dleyna-renderer-service.conf.in | 4 | ||||
-rw-r--r-- | libdleyna/renderer/host-service.c | 11 | ||||
-rw-r--r-- | libdleyna/renderer/host-service.h | 3 | ||||
-rw-r--r-- | libdleyna/renderer/server.c | 1 | ||||
-rw-r--r-- | libdleyna/renderer/upnp.c | 3 | ||||
-rw-r--r-- | libdleyna/renderer/upnp.h | 1 |
6 files changed, 18 insertions, 5 deletions
diff --git a/libdleyna/renderer/dleyna-renderer-service.conf.in b/libdleyna/renderer/dleyna-renderer-service.conf.in index 3a6fceb..cede1fd 100644 --- a/libdleyna/renderer/dleyna-renderer-service.conf.in +++ b/libdleyna/renderer/dleyna-renderer-service.conf.in @@ -15,6 +15,10 @@ connector-name=@with_connector_name@ # Source port for SSDP messages #port=4321 +# Port for Push host fileserver +# If unset, a random available port will be used. +#push-host-port=5432 + # Log configuration options [log] diff --git a/libdleyna/renderer/host-service.c b/libdleyna/renderer/host-service.c index 41f8c7f..3392d45 100644 --- a/libdleyna/renderer/host-service.c +++ b/libdleyna/renderer/host-service.c @@ -58,6 +58,7 @@ struct dlr_host_server_t_ { struct dlr_host_service_t_ { GHashTable *servers; + guint port; }; static void prv_compute_mime_and_dlna_header(const gchar *filename, @@ -375,12 +376,13 @@ on_error: } static dlr_host_server_t *prv_host_server_new(const gchar *device_if, + guint port, GError **error) { dlr_host_server_t *server = NULL; SoupAddress *addr; - addr = soup_address_new(device_if, SOUP_ADDRESS_ANY_PORT); + addr = soup_address_new(device_if, port); if (soup_address_resolve_sync(addr, NULL) != SOUP_STATUS_OK) { *error = g_error_new(DLEYNA_SERVER_ERROR, @@ -408,13 +410,14 @@ on_error: return server; } -void dlr_host_service_new(dlr_host_service_t **host_service) +void dlr_host_service_new(dlr_host_service_t **host_service, guint port) { dlr_host_service_t *hs; hs = g_new(dlr_host_service_t, 1); hs->servers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, prv_host_server_delete); + hs->port = port; *host_service = hs; } @@ -467,7 +470,9 @@ gchar *dlr_host_service_add(dlr_host_service_t *host_service, server = g_hash_table_lookup(host_service->servers, device_if); if (!server) { - server = prv_host_server_new(device_if, error); + server = prv_host_server_new(device_if, + host_service->port, + error); if (!server) goto on_error; diff --git a/libdleyna/renderer/host-service.h b/libdleyna/renderer/host-service.h index a05a529..4f61499 100644 --- a/libdleyna/renderer/host-service.h +++ b/libdleyna/renderer/host-service.h @@ -25,7 +25,8 @@ typedef struct dlr_host_service_t_ dlr_host_service_t; -void dlr_host_service_new(dlr_host_service_t **host_service); +void dlr_host_service_new(dlr_host_service_t **host_service, + guint port); gchar *dlr_host_service_add(dlr_host_service_t *host_service, const gchar *device_if, const gchar *client, diff --git a/libdleyna/renderer/server.c b/libdleyna/renderer/server.c index a0e52e4..6d5afa6 100644 --- a/libdleyna/renderer/server.c +++ b/libdleyna/renderer/server.c @@ -1127,6 +1127,7 @@ static gboolean prv_control_point_start_service( if (g_context.dlr_id[DLR_MANAGER_INTERFACE_MANAGER]) { g_context.upnp = dlr_upnp_new(connection, dleyna_settings_port(g_context.settings), + dleyna_settings_push_host_port(g_context.settings), g_server_vtables, prv_found_media_server, prv_lost_media_server); diff --git a/libdleyna/renderer/upnp.c b/libdleyna/renderer/upnp.c index fb12b1e..0c9c30c 100644 --- a/libdleyna/renderer/upnp.c +++ b/libdleyna/renderer/upnp.c @@ -362,6 +362,7 @@ static void prv_on_context_available(GUPnPContextManager *context_manager, dlr_upnp_t *dlr_upnp_new(dleyna_connector_id_t connection, guint port, + guint push_host_port, const dleyna_connector_dispatch_cb_t *dispatch_table, dlr_upnp_callback_t found_server, dlr_upnp_callback_t lost_server) @@ -386,7 +387,7 @@ dlr_upnp_t *dlr_upnp_new(dleyna_connector_id_t connection, G_CALLBACK(prv_on_context_available), upnp); - dlr_host_service_new(&upnp->host_service); + dlr_host_service_new(&upnp->host_service, push_host_port); return upnp; } diff --git a/libdleyna/renderer/upnp.h b/libdleyna/renderer/upnp.h index f888821..9e82db0 100644 --- a/libdleyna/renderer/upnp.h +++ b/libdleyna/renderer/upnp.h @@ -43,6 +43,7 @@ typedef void (*dlr_upnp_task_complete_t)(dlr_task_t *task, GError *error); dlr_upnp_t *dlr_upnp_new(dleyna_connector_id_t connection, uint port, + uint push_host_port, const dleyna_connector_dispatch_cb_t *dispatch_table, dlr_upnp_callback_t found_server, dlr_upnp_callback_t lost_server); |