diff --git a/ajaxui/ajaxui.c b/ajaxui/ajaxui.c
index 72652986..0da4b569 100644
--- a/ajaxui/ajaxui.c
+++ b/ajaxui/ajaxui.c
@@ -268,16 +268,15 @@ ajax_a_jsfunc(tcp_queue_t *tq, const char *innerhtml, const char *func,
* Titlebar AJAX page
*/
static int
-ajax_page_titlebar(http_connection_t *hc, const char *remain, void *opaque)
+ajax_page_titlebar(http_connection_t *hc, http_reply_t *hr,
+ const char *remain, void *opaque)
{
- tcp_queue_t tq;
-
if(remain == NULL)
return HTTP_STATUS_NOT_FOUND;
- tcp_init_queue(&tq, -1);
- ajax_menu_bar_from_array(&tq, "top", ajax_tabnames, AJAX_TABS, atoi(remain));
- http_output_queue(hc, &tq, "text/html; charset=UTF-8", 0);
+ ajax_menu_bar_from_array(&hr->hr_tq, "top",
+ ajax_tabnames, AJAX_TABS, atoi(remain));
+ http_output_html(hc, hr);
return 0;
}
@@ -287,20 +286,18 @@ ajax_page_titlebar(http_connection_t *hc, const char *remain, void *opaque)
* About
*/
static int
-ajax_about_tab(http_connection_t *hc)
+ajax_about_tab(http_connection_t *hc, http_reply_t *hr)
{
- tcp_queue_t tq;
+ tcp_queue_t *tq = &hr->hr_tq;
- tcp_init_queue(&tq, -1);
+ tcp_qprintf(tq, "
");
+ tcp_qprintf(tq, "");
- tcp_qprintf(&tq, "
");
- tcp_qprintf(&tq, "");
+ ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, "About");
- ajax_box_begin(&tq, AJAX_BOX_SIDEBOX, NULL, NULL, "About");
+ tcp_qprintf(tq, "
");
- tcp_qprintf(&tq, "
");
-
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"
HTS / Tvheadend
"
"
(c) 2006-2008 Andreas \303\226man
"
"
Latest release and information is available at:
"
@@ -317,12 +314,12 @@ ajax_about_tab(http_connection_t *hc)
"
FFmpeg
"
);
- tcp_qprintf(&tq, "
");
- ajax_box_end(&tq, AJAX_BOX_SIDEBOX);
- tcp_qprintf(&tq, "
");
- tcp_qprintf(&tq, "");
+ tcp_qprintf(tq, "
");
+ ajax_box_end(tq, AJAX_BOX_SIDEBOX);
+ tcp_qprintf(tq, " ");
+ tcp_qprintf(tq, "");
- http_output_queue(hc, &tq, "text/html; charset=UTF-8", 0);
+ http_output_html(hc, hr);
return 0;
}
@@ -334,7 +331,8 @@ ajax_about_tab(http_connection_t *hc)
* Find the 'tab' id and continue with tab specific code
*/
static int
-ajax_page_tab(http_connection_t *hc, const char *remain, void *opaque)
+ajax_page_tab(http_connection_t *hc, http_reply_t *hr,
+ const char *remain, void *opaque)
{
int tab;
@@ -345,13 +343,13 @@ ajax_page_tab(http_connection_t *hc, const char *remain, void *opaque)
switch(tab) {
case AJAX_TAB_CHANNELS:
- return ajax_channelgroup_tab(hc);
+ return ajax_channelgroup_tab(hc, hr);
case AJAX_TAB_CONFIGURATION:
- return ajax_config_tab(hc);
+ return ajax_config_tab(hc, hr);
case AJAX_TAB_ABOUT:
- return ajax_about_tab(hc);
+ return ajax_about_tab(hc, hr);
default:
return HTTP_STATUS_NOT_FOUND;
@@ -365,13 +363,12 @@ ajax_page_tab(http_connection_t *hc, const char *remain, void *opaque)
* Root page
*/
static int
-ajax_page_root(http_connection_t *hc, const char *remain, void *opaque)
+ajax_page_root(http_connection_t *hc, http_reply_t *hr,
+ const char *remain, void *opaque)
{
- tcp_queue_t tq;
+ tcp_queue_t *tq = &hr->hr_tq;
- tcp_init_queue(&tq, -1);
-
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
""
/*
@@ -388,110 +385,50 @@ ajax_page_root(http_connection_t *hc, const char *remain, void *opaque)
"content=\"text/html; charset=utf-8\">\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"\r\n");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"");
- tcp_qprintf(&tq,
+ tcp_qprintf(tq,
"");
- ajax_box_begin(&tq, AJAX_BOX_FILLED, "topmenu", NULL, NULL);
- ajax_box_end(&tq, AJAX_BOX_FILLED);
+ ajax_box_begin(tq, AJAX_BOX_FILLED, "topmenu", NULL, NULL);
+ ajax_box_end(tq, AJAX_BOX_FILLED);
- tcp_qprintf(&tq, "");
+ tcp_qprintf(tq, "");
- ajax_js(&tq, "switchtab('top', '0')");
+ ajax_js(tq, "switchtab('top', '0')");
- tcp_qprintf(&tq, "