From 0b04481c8d27cebbce45845cc78ebb6a7003d586 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 17 Mar 2010 04:25:45 +0000
Subject: [PATCH] Added support for [CGI.<os>] section in ctrl/web_handler.ini
 file allowing for OS/platform-specific CGI handlers without requiring a
 separate web_handler.ini.

---
 src/sbbs3/websrvr.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c
index 92ad44a7e0..cf6b67648b 100644
--- a/src/sbbs3/websrvr.c
+++ b/src/sbbs3/websrvr.c
@@ -1723,9 +1723,9 @@ static named_string_t** read_ini_list(char* path, char* section, char* desc
 		iniCloseFile(fp);
 		COUNT_LIST_ITEMS(list,i);
 		if(i)
-			lprintf(LOG_DEBUG,"Read %u %s from %s",i,desc,path);
+			lprintf(LOG_DEBUG,"Read %u %s from %s section of %s"
+				,i,desc,section==NULL ? "root":section,path);
 	}
-
 	return(list);
 }
 
@@ -5473,8 +5473,10 @@ void DLLCALL web_server(void* arg)
 		mime_types=read_ini_list(mime_types_ini,NULL /* root section */,"MIME types"
 			,mime_types);
 		iniFileName(web_handler_ini,sizeof(web_handler_ini),scfg.ctrl_dir,"web_handler.ini");
-		cgi_handlers=read_ini_list(web_handler_ini,"CGI","CGI content handlers"
-			,cgi_handlers);
+		if((cgi_handlers=read_ini_list(web_handler_ini,"CGI."PLATFORM_DESC,"CGI content handlers"
+			,cgi_handlers))==NULL)
+			cgi_handlers=read_ini_list(web_handler_ini,"CGI","CGI content handlers"
+				,cgi_handlers);
 		xjs_handlers=read_ini_list(web_handler_ini,"JavaScript","JavaScript content handlers"
 			,xjs_handlers);
 
-- 
GitLab