[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: stop refreshing json output #1217

git at icinga.org git at icinga.org
Sat Apr 30 13:14:28 CEST 2011


Module: icinga-core
Branch: mfriedrich/core
Commit: 40c0680c5abf089e0500ae5c1bce5015ae4add5b
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=40c0680c5abf089e0500ae5c1bce5015ae4add5b

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Thu Apr 28 22:14:39 2011 +0200

stop refreshing json output #1217

refs: #1217

---

 cgi/cgiutils.c |    7 +++++++
 cgi/tac.c      |    5 -----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/cgi/cgiutils.c b/cgi/cgiutils.c
index e2fb43b..53b3db6 100644
--- a/cgi/cgiutils.c
+++ b/cgi/cgiutils.c
@@ -838,6 +838,8 @@ void document_header(int cgi_id, int use_stylesheet){
                         cgi_css         = TAC_CSS;
                         cgi_title       = "Tactical Monitoring Overview";
                         cgi_body_class  = "tac";
+			if (tac_header==TRUE && show_tac_header==FALSE)
+				refresh=FALSE;
                         break;
                 case TRENDS_CGI_ID:
                         cgi_name        = TRENDS_CGI;
@@ -854,6 +856,11 @@ void document_header(int cgi_id, int use_stylesheet){
                         break;
         }
 
+
+	// don't refresh non html output
+	if(content_type==JSON_CONTENT || content_type==CSV_CONTENT)
+		refresh=FALSE;
+
 	if(content_type==WML_CONTENT){
                 /* used by cmd.cgi */
 		printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset);
diff --git a/cgi/tac.c b/cgi/tac.c
index 4ea6f31..87f0ce0 100644
--- a/cgi/tac.c
+++ b/cgi/tac.c
@@ -277,11 +277,6 @@ int main(void){
 	time(&t5);
 #endif
 
-	/* no need to refresh if this is not the tac_header */
-        if(tac_header==TRUE && show_tac_header==FALSE){
-		refresh=FALSE;
-	}
-
 	document_header(CGI_ID,TRUE);
 
 	/* get authentication information */





More information about the icinga-checkins mailing list