myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. 5499197f68


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 5499197f680099587aee598f234838f764d56484
Date: Thu, 20 Aug 2009 20:06:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  5499197f680099587aee598f234838f764d56484 (commit)
      from  6bc604a42ff4baae96d50ab9a69f1bd9fab65be2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit 5499197f680099587aee598f234838f764d56484
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Aug 20 22:04:54 2009 +0200

    Remove unused files added by the last commit.

diff --git a/plugins/src/mime_magic/.svn/dir-prop-base 
b/plugins/src/mime_magic/.svn/dir-prop-base
deleted file mode 100755
index 3160658..0000000
--- a/plugins/src/mime_magic/.svn/dir-prop-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 13
-svn:mergeinfo
-V 0
-
-END
diff --git a/plugins/src/mime_magic/.svn/entries 
b/plugins/src/mime_magic/.svn/entries
deleted file mode 100755
index c0889e9..0000000
--- a/plugins/src/mime_magic/.svn/entries
+++ /dev/null
@@ -1,198 +0,0 @@
-9
-
-dir
-2915
-svn+ssh://svn.savannah.gnu.org/myserver/trunk/plugins/src/http_checker
-svn+ssh://svn.savannah.gnu.org/myserver
-
-
-
-2008-10-26T19:37:37.786994Z
-2913
-dperrone
-has-props
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-c4c922ea-a70d-0410-937d-ec1daf91936c
-
-http_rules_sample.py
-file
-
-
-
-
-2008-10-26T19:53:56.000000Z
-e61d209f6980c329e3795139269735c4
-2007-06-27T17:27:50.877877Z
-2361
-rocky_10_balboa
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-178
-
-http_checker.cpp
-file
-
-
-
-
-2008-10-26T19:53:56.000000Z
-4e6fa7755d56cc869aca2ecbc983fe6d
-2008-10-26T19:37:37.786994Z
-2913
-dperrone
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-8318
-
-SConscript
-file
-
-
-
-
-2008-10-26T19:53:56.000000Z
-7af7e7f0ecaf27a4f285cb25693802b7
-2008-10-26T19:37:37.786994Z
-2913
-dperrone
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-833
-
-README
-file
-
-
-
-
-2008-10-26T19:53:56.000000Z
-c183d3026fc5de262d58657ce90a4dd2
-2007-06-27T17:27:50.877877Z
-2361
-rocky_10_balboa
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1093
-
-plugin.xml
-file
-
-
-
-
-2008-10-26T19:53:56.000000Z
-12098a0843a40122c30920847a26d14f
-2008-10-26T19:37:37.786994Z
-2913
-dperrone
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-313
-
diff --git a/plugins/src/mime_magic/.svn/format 
b/plugins/src/mime_magic/.svn/format
deleted file mode 100755
index ec63514..0000000
--- a/plugins/src/mime_magic/.svn/format
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/plugins/src/mime_magic/.svn/text-base/README.svn-base 
b/plugins/src/mime_magic/.svn/text-base/README.svn-base
deleted file mode 100755
index b68b7dc..0000000
--- a/plugins/src/mime_magic/.svn/text-base/README.svn-base
+++ /dev/null
@@ -1,40 +0,0 @@
-A HTTP checker rule is added trough the main myserver.xml
-configuration file, a rule is a python script to execute on every HTTP
-request, for example this rule denies any access if the client
-used the host localhost:8080 to connect to the server.
-
-This plugin needs the executors/python plugin to be installed too.
-
-<HTTP_CHECKER_RULE>
-<![CDATA[
-from http_checker import get_header
-from http_checker import raise_error
-
-if get_header('Host') == "localhost:8080":
-       raise_error(401)
-]]>
-</HTTP_CHECKER_RULE>
-
-If the rules are complicated then it is possible to use an external
-python file to execute:
-
-<HTTP_CHECKER_RULE file="http_rules_sample.py" />
-
-
-Functions in the http_checker module:
-
-get_remote_port() - Get the client TCP port.
-
-get_local_port() - Get the local TCP port.
-
-get_remote_addr() - Get the remote IP address.
-
-get_local_addr() - Get the local IP address.
-
-set_header(header, value) - Set HTTP header field value.
-
-get_header(header) - Get HTTP header field value.
-
-send_redirect(page) - Send a redirect to another location.
-
-raise_error(error_code) - Raise HTTP error page.
diff --git a/plugins/src/mime_magic/.svn/text-base/SConscript.svn-base 
b/plugins/src/mime_magic/.svn/text-base/SConscript.svn-base
deleted file mode 100755
index d63c425..0000000
--- a/plugins/src/mime_magic/.svn/text-base/SConscript.svn-base
+++ /dev/null
@@ -1,30 +0,0 @@
-#-*- mode: python -*-
-Import('dest_dir','listinc')
-
-local_listinc=[
-      GetLaunchDir(),
-      '../../../',
-      '/usr/local/include',
-      '/usr/include/',
-      '/usr/include/python2.5',
-      '/usr/local/include/python2.5',
-      '/usr/local/include/libxml2',
-      '/usr/include/libxml2',
-      '.'
-      ]
-
-local_listinc.extend(listinc)
-
-env = Environment(CPPPATH=local_listinc)
-
-conf = Configure(env, config_h="config.h")
-
-if conf.CheckHeader("Python.h"):
-    conf.Define('PYTHON', 1)
-
-env = conf.Finish()
-
-env.SharedLibrary(GetLaunchDir() + "/" + dest_dir + "/http_checker", 
["http_checker.cpp" ], SHLIBPREFIX="")
-
-Command(GetLaunchDir() + "/" + dest_dir + "/README","README", Copy("$TARGET", 
"$SOURCE"))
-Command(GetLaunchDir() + "/" + dest_dir + 
"/http_rules_sample.py","http_rules_sample.py", Copy("$TARGET", "$SOURCE"))
diff --git a/plugins/src/mime_magic/.svn/text-base/http_checker.cpp.svn-base 
b/plugins/src/mime_magic/.svn/text-base/http_checker.cpp.svn-base
deleted file mode 100755
index 8c5a166..0000000
--- a/plugins/src/mime_magic/.svn/text-base/http_checker.cpp.svn-base
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
-MyServer
-Copyright (C) 2007 The Free Software Foundation Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-#include <stdafx.h>
-#include <string.h>
-#include <include/server/server.h>
-#include <include/base/multicast/multicast.h>
-#include <include/protocol/http/http.h>
-#include <include/plugin/plugin.h>
-#include <Python.h>
-
-#ifdef WIN32
-#define EXPORTABLE(x) x _declspec(dllexport)
-#else
-#define EXPORTABLE(x) extern "C" x
-#endif
-
-typedef int (*executePROC)(char*, u_long);
-typedef int (*executeFromFilePROC)(char*);
-
-
-struct ThreadData
-{
-       HttpThreadContext* td;
-       int ret;
-};
-
-static HashMap<ThreadID, ThreadData*> pythonThreadData;
-static Mutex mutex;
-
-typedef int (*INIT_MODULE)(char* name, PyMethodDef methods[]);
-static INIT_MODULE init;
-
-
-static ThreadData* getThreadData()
-{
-       ThreadID tid = Thread::threadID();
-       ThreadData* ret;
-       mutex.lock();
-       ret = pythonThreadData.get(tid);
-       mutex.unlock();
-       return ret;
-}
-
-static HttpThreadContext* getThreadContext()
-{
-       return getThreadData()->td;
-}
-
-static PyObject *get_remote_addr(PyObject *self, PyObject *args)
-{
-       HttpThreadContext* context = getThreadContext();
-               return Py_BuildValue((char*)"s", 
context->connection->getIpAddr());
-}
-
-static PyObject *get_remote_port(PyObject *self, PyObject *args)
-{
-       HttpThreadContext* context = getThreadContext();
-               return Py_BuildValue((char*)"i", 
context->connection->getPort());
-}
-
-static PyObject *get_local_addr(PyObject *self, PyObject *args)
-{
-       HttpThreadContext* context = getThreadContext();
-               return Py_BuildValue((char*)"s", 
context->connection->getLocalIpAddr());
-}
-
-static PyObject *get_local_port(PyObject *self, PyObject *args)
-{
-       HttpThreadContext* context = getThreadContext();
-               return Py_BuildValue((char*)"i", 
context->connection->getLocalPort());
-}
-
-
-static PyObject *get_header(PyObject *self, PyObject *args)
-{
-       char *header;
-       string value;
-       if (!PyArg_ParseTuple(args, (char*)"s", &header))
-               return NULL;
-
-       HttpThreadContext* context = getThreadContext();
-
-       context->request.getValue(header, &value);
-
-       return Py_BuildValue((char*)"s", value.c_str());
-}
-
-static PyObject *set_header(PyObject *self, PyObject *args)
-{
-       char *header;
-       char *value;
-       const char* ret;
-       if (!PyArg_ParseTuple(args, (char*)"ss", &header, &value))
-               return NULL;
-
-       HttpThreadContext* context = getThreadContext();
-
-       ret = context->request.setValue(header, value)->c_str();
-
-       return Py_BuildValue((char*)"s", ret);
-}
-
-static PyObject *raise_error(PyObject *self, PyObject *args)
-{
-       int error;
-       if (!PyArg_ParseTuple(args, (char*)"i", &error))
-               return NULL;
-
-       ThreadData* data = getThreadData();
-
-       if(data->ret)
-               return NULL;
-
-       data->td->http->raiseHTTPError(error);
-
-       data->ret = 1;
-
-       return Py_BuildValue((char*)"s", "");
-}
-
-static PyObject *send_redirect(PyObject *self, PyObject *args)
-{
-       char* dest;
-       if (!PyArg_ParseTuple(args, (char*)"s", &dest))
-               return NULL;
-
-       ThreadData* data = getThreadData();
-
-       if(data->ret)
-               return NULL;
-
-       data->td->http->sendHTTPRedirect(dest);
-
-       data->ret = 1;
-
-       return Py_BuildValue((char*)"s", dest);
-}
-
-static PyMethodDef httpCheckerMethods[] = {
-       {(char*)"get_remote_port", get_remote_port, METH_VARARGS, (char*)"Get 
the remote TCP port"},
-       {(char*)"get_local_port", get_local_port, METH_VARARGS, (char*)"Get the 
local TCP port"},
-       {(char*)"get_remote_addr", get_remote_addr, METH_VARARGS, (char*)"Get 
the remote IP address"},
-       {(char*)"get_local_addr", get_local_addr, METH_VARARGS, (char*)"Get the 
local IP address"},
-       {(char*)"get_header", get_header, METH_VARARGS, (char*)"Get HTTP header 
field value"},
-       {(char*)"set_header", set_header, METH_VARARGS, (char*)"Set HTTP header 
field value"},
-       {(char*)"send_redirect", send_redirect, METH_VARARGS, (char*)"Send a 
redirect to another location"},
-       {(char*)"raise_error", raise_error, METH_VARARGS, (char*)"Raise HTTP 
error page"},
-       {NULL, NULL, 0, NULL}
-};
-
-
-class HttpObserver : public Multicast<string, void*, int>
-{
-       struct Item
-       {
-               string data;
-               bool file;
-       };
-public:
-
-       virtual int updateMulticast(MulticastRegistry<string, void*, int>* reg, 
string& msg, void* arg)
-       {
-               HttpThreadContext *td = (HttpThreadContext*)arg;
-               ThreadID tid = Thread::threadID();
-               list<Item>::iterator it;
-               mutex.lock();
-               ThreadData threadData = {td, 0};
-               pythonThreadData.put(tid, &threadData);
-               mutex.unlock();
-
-               init((char*)"http_checker", httpCheckerMethods);
-
-               for(it = rules.begin(); it != rules.end(); it++)
-               {
-                       if((*it).file) 
-                       {
-                               executeFromFilePROC execute = 
((executeFromFilePROC)python->getDirectMethod((char*)"executeFromFile"));
-                               if (execute)
-                                 execute((char*)(*it).data.c_str());
-                       }else
-                       {
-                               executePROC execute = 
((executePROC)python->getDirectMethod((char*)"execute"));
-                               
-                               if (execute)
-                                 execute((char*)(*it).data.c_str(), 
(*it).data.length());
-                       }
-               }
-               return threadData.ret;
-       }
-
-       void addRule(const char* rule, bool file)
-       {
-               Item it;
-               it.data.assign(rule);
-               it.file = file;
-               rules.push_back(it);
-       }
-
-       void setPythonExecutor(Plugin* python){this->python = python;}
-
-private:
-       list<Item> rules;
-       Plugin* python;
-};
-
-static HttpObserver observer;
-
-EXPORTABLE(char*) name(char* name, u_long len)
-{
-       char* str = (char*)"http_checker";
-       if(name)
-               strncpy(name, str, len);
-       return str;
-}
-
-EXPORTABLE(int) load(void* server,void* parser)
-{
-       Server* serverInstance = (Server*)server;
-       HttpStaticData* staticData =(HttpStaticData*) 
serverInstance->getGlobalData("http-static");
-       string msg("new-http-request");
-       string pythonName("python");
-       Plugin* python;
-       XmlParser* configuration;
-       xmlDocPtr xmlDoc;
-       if(!staticData)
-       {
-               serverInstance->logLockAccess();
-               serverInstance->logPreparePrintError();
-               serverInstance->logWriteln("HttpChecker: Invalid HTTP static 
data");
-               serverInstance->logEndPrintError();
-               serverInstance->logUnlockAccess();
-               return -1;
-       }
-       python = serverInstance->getPluginsManager()->getPlugin(pythonName);
-
-       if(!python)
-       {
-               serverInstance->logLockAccess();
-               serverInstance->logPreparePrintError();
-               serverInstance->logWriteln("HttpChecker: Cannot find 
executors::python");
-               serverInstance->logEndPrintError();
-               serverInstance->logUnlockAccess();
-               return -1;
-       }
-       observer.setPythonExecutor(python);
-
-       staticData->addMulticast(msg, &observer);
-
-       init = (INIT_MODULE) python->getDirectMethod((char*)"initModule");
-
-       if(!init)
-       {
-               serverInstance->logLockAccess();
-               serverInstance->logPreparePrintError();
-               serverInstance->logWriteln("HttpChecker: Cannot find method 
initModule in executors::python");
-               serverInstance->logEndPrintError();
-               serverInstance->logUnlockAccess();
-               return -1;
-       }
-       configuration = serverInstance->getConfiguration();
-       xmlDoc = configuration->getDoc();
-
-       for(xmlNodePtr ptr = xmlDoc->children->next->children; ptr; ptr = 
ptr->next)
-       {
-               if(!xmlStrcmp(ptr->name, (const xmlChar *)"HTTP_CHECKER_RULE"))
-               {
-                       bool file = false;
-                       xmlAttrPtr properties = ptr->properties;
-                       char* data = 0;
-                       while(properties)
-                       {
-                               if(!xmlStrcmp(properties->name, (const xmlChar 
*)"file"))
-                               {
-                                       if(properties->children && 
properties->children->content)
-                                               data = 
(char*)properties->children->content;
-
-                                       file = true;
-                               }
-                               properties = properties->next;
-                       }
-
-                       if(!file && ptr->children && ptr->children->next && 
ptr->children->next->content)
-                               data = (char*)ptr->children->next->content;
-
-                       if(!data)
-                       {
-                               serverInstance->logLockAccess();
-                               serverInstance->logPreparePrintError();
-                               serverInstance->logWriteln("HttpChecker: 
Invalid rule");
-                               serverInstance->logEndPrintError();
-                               serverInstance->logUnlockAccess();
-                               return -1;
-                       }
-
-                       observer.addRule(data, file);
-               }
-
-       }
-
-       mutex.init();
-
-       return 0;
-}
-EXPORTABLE(int) postLoad(void* server,void* parser)
-{
-       return 0;
-}
-EXPORTABLE(int) unLoad(void* parser)
-{
-       mutex.destroy();
-       return 0;
-}
diff --git 
a/plugins/src/mime_magic/.svn/text-base/http_rules_sample.py.svn-base 
b/plugins/src/mime_magic/.svn/text-base/http_rules_sample.py.svn-base
deleted file mode 100755
index dbf5ead..0000000
--- a/plugins/src/mime_magic/.svn/text-base/http_rules_sample.py.svn-base
+++ /dev/null
@@ -1,6 +0,0 @@
-from http_checker import *
-
-# This simple rule returns a 404 error page to every request from the
-# host 192.168.0.2.
-if get_remote_addr() == "192.168.0.2":
-    raise_error(404)
diff --git a/plugins/src/mime_magic/.svn/text-base/plugin.xml.svn-base 
b/plugins/src/mime_magic/.svn/text-base/plugin.xml.svn-base
deleted file mode 100755
index 8af05d9..0000000
--- a/plugins/src/mime_magic/.svn/text-base/plugin.xml.svn-base
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-
-<PLUGIN>
-<NAME>http_checker</NAME>
-<VERSION>0.1</VERSION>
-<AUTHOR>The Free Software Foundation Inc.</AUTHOR>
-<MAINTAINER>The Free Software Foundation Inc.</MAINTAINER>
-<DESCRIPTION>This plugin permits to validate HTTP requests using 
python</DESCRIPTION>
-<DEPENDS>python</DEPENDS>
-</PLUGIN>

-----------------------------------------------------------------------

Summary of changes:
 plugins/src/mime_magic/.svn/dir-prop-base          |    5 -
 plugins/src/mime_magic/.svn/entries                |  198 ------------
 plugins/src/mime_magic/.svn/format                 |    1 -
 .../src/mime_magic/.svn/text-base/README.svn-base  |   40 ---
 .../mime_magic/.svn/text-base/SConscript.svn-base  |   30 --
 .../.svn/text-base/http_checker.cpp.svn-base       |  326 --------------------
 .../.svn/text-base/http_rules_sample.py.svn-base   |    6 -
 .../mime_magic/.svn/text-base/plugin.xml.svn-base  |   10 -
 8 files changed, 0 insertions(+), 616 deletions(-)
 delete mode 100755 plugins/src/mime_magic/.svn/dir-prop-base
 delete mode 100755 plugins/src/mime_magic/.svn/entries
 delete mode 100755 plugins/src/mime_magic/.svn/format
 delete mode 100755 plugins/src/mime_magic/.svn/text-base/README.svn-base
 delete mode 100755 plugins/src/mime_magic/.svn/text-base/SConscript.svn-base
 delete mode 100755 
plugins/src/mime_magic/.svn/text-base/http_checker.cpp.svn-base
 delete mode 100755 
plugins/src/mime_magic/.svn/text-base/http_rules_sample.py.svn-base
 delete mode 100755 plugins/src/mime_magic/.svn/text-base/plugin.xml.svn-base


hooks/post-receive
-- 
GNU MyServer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]