mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
add support for parsing javascript files (yjs)
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@542 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -63,7 +63,7 @@ THandleStatus CNeutrinoYParser::Hook_SendResponse(CyhookHandler *hh)
|
|||||||
init(hh);
|
init(hh);
|
||||||
|
|
||||||
CNeutrinoYParser *yP = new CNeutrinoYParser(NeutrinoAPI); // create a Session
|
CNeutrinoYParser *yP = new CNeutrinoYParser(NeutrinoAPI); // create a Session
|
||||||
if(hh->UrlData["fileext"] == "yhtm") // yParser for yhtm-File
|
if (hh->UrlData["fileext"] == "yhtm" || hh->UrlData["fileext"] == "yjs" || hh->UrlData["fileext"] == "ysh") // yParser for y*-Files
|
||||||
yP->ParseAndSendFile(hh);
|
yP->ParseAndSendFile(hh);
|
||||||
else if(hh->UrlData["path"] == "/y/") // /y/<cgi> commands
|
else if(hh->UrlData["path"] == "/y/") // /y/<cgi> commands
|
||||||
{
|
{
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// General central Definitions <configure!>
|
// General central Definitions <configure!>
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#define HTTPD_VERSION "3.2.8" // Webserver version (can be overloaded)
|
#define HTTPD_VERSION "3.3.0" // Webserver version (can be overloaded)
|
||||||
#define YHTTPD_VERSION "1.3.1" // Webserver version (Version of yhttpd-core!)
|
#define YHTTPD_VERSION "1.3.1" // Webserver version (Version of yhttpd-core!)
|
||||||
#define IADDR_LOCAL "127.0.0.1" // local IP
|
#define IADDR_LOCAL "127.0.0.1" // local IP
|
||||||
#define HTTPD_NAME "yhttpd" // Webserver name (can be overloaded)
|
#define HTTPD_NAME "yhttpd" // Webserver name (can be overloaded)
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Configurations for LINUX (Tuxbox dbox2, coolstream)
|
// Configurations for LINUX (Tuxbox dbox2, coolstream)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------,js:text/plain------
|
||||||
#undef HTTPD_NAME
|
#undef HTTPD_NAME
|
||||||
#define HTTPD_NAME "nhttpd"
|
#define HTTPD_NAME "nhttpd"
|
||||||
#define HTTPD_STANDARD_PORT 80
|
#define HTTPD_STANDARD_PORT 80
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
#define UPLOAD_TMP_FILE "/tmp/upload.tmp"
|
#define UPLOAD_TMP_FILE "/tmp/upload.tmp"
|
||||||
#define CACHE_DIR "/tmp/.cache"
|
#define CACHE_DIR "/tmp/.cache"
|
||||||
#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm"
|
#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm"
|
||||||
#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip"
|
#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,yjs:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip"
|
||||||
#define HTTPD_SENDFILE_ALL "false"
|
#define HTTPD_SENDFILE_ALL "false"
|
||||||
#define HTTPD_LANGUAGEDIR "languages"
|
#define HTTPD_LANGUAGEDIR "languages"
|
||||||
#define HTTPD_DEFAULT_LANGUAGE "English"
|
#define HTTPD_DEFAULT_LANGUAGE "English"
|
||||||
|
@@ -494,8 +494,9 @@ void Cyhttpd::ReadConfig(void) {
|
|||||||
}
|
}
|
||||||
// configure debugging & logging
|
// configure debugging & logging
|
||||||
if (CLogging::getInstance()->LogLevel == 0)
|
if (CLogging::getInstance()->LogLevel == 0)
|
||||||
CLogging::getInstance()->LogLevel = Config->getInt32(
|
CLogging::getInstance()->LogLevel = Config->getInt32("server.log.loglevel", 0);
|
||||||
"server.log.loglevel", 0);
|
if (CLogging::getInstance()->LogLevel > 0)
|
||||||
|
CLogging::getInstance()->setDebug(true);
|
||||||
|
|
||||||
// get variables
|
// get variables
|
||||||
webserver->init(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT),
|
webserver->init(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT),
|
||||||
|
@@ -67,7 +67,7 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) {
|
|||||||
log_level_printf(4, "mod_sendfile prepare hook start url:%s\n", hh->UrlData["fullurl"].c_str());
|
log_level_printf(4, "mod_sendfile prepare hook start url:%s\n", hh->UrlData["fullurl"].c_str());
|
||||||
std::string mime = sendfileTypes[hh->UrlData["fileext"]];
|
std::string mime = sendfileTypes[hh->UrlData["fileext"]];
|
||||||
if (((mime != "") || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true"))
|
if (((mime != "") || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true"))
|
||||||
&& (hh->UrlData["fileext"] != "yhtm")) {
|
&& !(hh->UrlData["fileext"] == "yhtm" || hh->UrlData["fileext"] == "yjs" || hh->UrlData["fileext"] == "ysh")) {
|
||||||
//TODO: Check allowed directories / actually in GetFileName
|
//TODO: Check allowed directories / actually in GetFileName
|
||||||
// build filename
|
// build filename
|
||||||
std::string fullfilename = GetFileName(hh, hh->UrlData["path"],
|
std::string fullfilename = GetFileName(hh, hh->UrlData["path"],
|
||||||
|
@@ -81,7 +81,7 @@ THandleStatus CyParser::Hook_SendResponse(CyhookHandler *hh) {
|
|||||||
init(hh);
|
init(hh);
|
||||||
|
|
||||||
CyParser *yP = new CyParser(); // create a Session
|
CyParser *yP = new CyParser(); // create a Session
|
||||||
if (hh->UrlData["fileext"] == "yhtm") // yParser for yhtm-File
|
if (hh->UrlData["fileext"] == "yhtm" || hh->UrlData["fileext"] == "yjs" || hh->UrlData["fileext"] == "ysh") // yParser for y*-Files
|
||||||
yP->ParseAndSendFile(hh);
|
yP->ParseAndSendFile(hh);
|
||||||
else if (hh->UrlData["path"] == "/y/") // /y/<cgi> commands
|
else if (hh->UrlData["path"] == "/y/") // /y/<cgi> commands
|
||||||
{
|
{
|
||||||
@@ -246,7 +246,7 @@ void CyParser::ParseAndSendFile(CyhookHandler *hh) {
|
|||||||
yresult = cgi_cmd_parsing(hh, ycmd, ydebug); // parsing engine
|
yresult = cgi_cmd_parsing(hh, ycmd, ydebug); // parsing engine
|
||||||
}
|
}
|
||||||
// parsing given file
|
// parsing given file
|
||||||
yresult += cgi_file_parsing(hh, hh->UrlData["filename"], ydebug);
|
yresult += cgi_file_parsing(hh, hh->UrlData["path"]+hh->UrlData["filename"], ydebug);
|
||||||
if (yresult.length() <= 0)
|
if (yresult.length() <= 0)
|
||||||
hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED);
|
hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED);
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user