From f0d06575dbe985f29377603cf4a92b14e4695e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Tue, 5 Feb 2008 19:14:31 +0000 Subject: [PATCH] no need to explicitly configure RTSP server IP, instead deduce info from established http connection --- htmlui.c | 16 ++++++++-------- main.c | 3 --- tvhead.h | 1 - 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/htmlui.c b/htmlui.c index 2a1c3a50..67f4fb9b 100644 --- a/htmlui.c +++ b/htmlui.c @@ -425,7 +425,8 @@ page_root(http_connection_t *hc, const char *remain, void *opaque) int simple = is_client_simple(hc); time_t firstend = INT32_MAX; th_channel_group_t *tcg; - + struct sockaddr_in *si; + if(!html_verify_access(hc, "browse-events")) return HTTP_STATUS_UNAUTHORIZED; @@ -485,13 +486,12 @@ page_root(http_connection_t *hc, const char *remain, void *opaque) "%s", ch->ch_tag, ch->ch_name); - if(tvheadend_streaming_host != NULL) { - tcp_qprintf(&tq, - "Watch live
", - tvheadend_streaming_host, http_port, ch->ch_sname); - } else { - tcp_qprintf(&tq, "
"); - } + si = (struct sockaddr_in *)&hc->hc_tcp_session.tcp_self_addr; + + tcp_qprintf(&tq, + "Watch live
", + inet_ntoa(si->sin_addr), ntohs(si->sin_port), + ch->ch_sname); e = epg_event_find_current_or_upcoming(ch); diff --git a/main.c b/main.c index 303bd03a..4446c224 100644 --- a/main.c +++ b/main.c @@ -60,7 +60,6 @@ int running; int xmltvreload; int startupcounter; -const char *tvheadend_streaming_host; const char *settings_dir; static pthread_mutex_t tag_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -205,8 +204,6 @@ main(int argc, char **argv) subscriptions_init(); - tvheadend_streaming_host = config_get_str("streaming-host", NULL); - htmlui_start(); avgen_init(); diff --git a/tvhead.h b/tvhead.h index 3cfd0e99..aec5e606 100644 --- a/tvhead.h +++ b/tvhead.h @@ -803,7 +803,6 @@ char *utf8toprintable(const char *in); char *utf8tofilename(const char *in); const char *htstvstreamtype2txt(tv_streamtype_t s); uint32_t tag_get(void); -extern const char *tvheadend_streaming_host; extern const char *settings_dir; FILE *settings_open_for_write(const char *name); FILE *settings_open_for_read(const char *name);