removed some unused non-apache2.2 friendly code
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 20 Jun 2006 11:45:31 +0000 (11:45 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 20 Jun 2006 11:45:31 +0000 (11:45 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4689 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/apachemods/mod_rest_gateway.h
Open-ILS/src/apachemods/mod_xmlent.c
OpenSRF/src/gateway/apachetools.c
OpenSRF/src/gateway/apachetools.h
OpenSRF/src/gateway/osrf_json_gateway.c

index fd7c793..571e3d6 100644 (file)
@@ -2,7 +2,7 @@
 #include "http_config.h"
 #include "http_core.h"
 #include "http_protocol.h"
-#include "apr_compat.h"
+//#include "apr_compat.h"
 #include "apr_strings.h"
 
 /* our stuff */
index 1e57611..84e7b3d 100644 (file)
@@ -3,7 +3,7 @@
 #include "http_core.h"
 #include "http_protocol.h"
 #include "http_request.h"
-#include "apr_compat.h"
+//#include "apr_compat.h"
 #include "apr_strings.h"
 #include "apr_reslist.h"
 #include "http_log.h"
@@ -172,8 +172,18 @@ static void printAttr( ap_filter_t* filter, const char** atts ) {
                const char* name = atts[i];
                const char* value = atts[i+1];
                char* escaped = ap_escape_html(filter->r->pool, value); 
-               OSRF_UTILS_REPLACE_CHAR(escaped,'\'','"');
-               _fwrite( filter, " %s='%s'", name, escaped );
+
+               /* we make a big assumption here that if the string contains a ', 
+                * then the original attribute was wrapped in "s - so recreate that */
+               if( strchr( escaped, '\'' ) ) {
+                       OSRF_UTILS_REPLACE_CHAR(escaped,'"','\'');
+                       _fwrite( filter, " %s=\"%s\"", name, escaped );
+
+               } else {
+                       OSRF_UTILS_REPLACE_CHAR(escaped,'\'','"');
+                       _fwrite( filter, " %s='%s'", name, escaped );
+               }
+
                i++;
        }
 }
index f975d62..d70bfe6 100644 (file)
@@ -176,29 +176,31 @@ int apacheError( char* msg, ... ) {
 
 
 /* taken more or less directly from O'Reillly - Writing Apache Modules in Perl and C */
+/* needs updating...
 apr_table_t* apacheParseCookies(request_rec *r) {
 
-   const char *data = ap_table_get(r->headers_in, "Cookie");
+   const char *data = apr_table_get(r->headers_in, "Cookie");
        osrfLogDebug(OSRF_LOG_MARK, "Loaded cookies: %s", data);
 
    apr_table_t* cookies;
    const char *pair;
    if(!data) return NULL;
 
-   cookies = ap_make_table(r->pool, 4);
+   cookies = apr_make_table(r->pool, 4);
    while(*data && (pair = ap_getword(r->pool, &data, ';'))) {
        const char *name, *value;
        if(*data == ' ') ++data;
        name = ap_getword(r->pool, &pair, '=');
        while(*pair && (value = ap_getword(r->pool, &pair, '&'))) {
            ap_unescape_url((char *)value);
-           ap_table_add(cookies, name, value);
+           apr_table_add(cookies, name, value);
        }
    }
 
     return cookies;
 }
 
+*/ 
 
 
index d034b40..3f20c4f 100644 (file)
@@ -2,7 +2,7 @@
 #include "http_config.h"
 #include "http_core.h"
 #include "http_protocol.h"
-#include "apr_compat.h"
+//#include "apr_compat.h"
 #include "apr_strings.h"
 #include "apr_reslist.h"
 #include "http_log.h"
@@ -49,7 +49,9 @@ int apacheError( char* msg, ... );
 /*
  * Creates an apache table* of cookie name / value pairs 
  */
+/*
 apr_table_t* apacheParseCookies(request_rec *r);
+*/
 
 
 #endif
index b4b1bd5..6de37c9 100644 (file)
@@ -108,7 +108,7 @@ static int osrf_json_gateway_method_handler (request_rec *r) {
        char* a_l                       = NULL; /* request api level */
        int   isXML                     = 0;
        int   api_level = 1;
-       apr_table_t* cookies = NULL;
+       //apr_table_t* cookies = NULL;
 
        r->allowed |= (AP_METHOD_BIT << M_GET);
        r->allowed |= (AP_METHOD_BIT << M_POST);
@@ -143,10 +143,12 @@ static int osrf_json_gateway_method_handler (request_rec *r) {
 
        } else {
 
+               /*
                if( 0 && (cookies = apacheParseCookies(r)) ) {
                        const char* authtoken = apr_table_get(cookies, "ses");
                        osrfLogInfo(OSRF_LOG_MARK, "SESSION = %s", authtoken);
                }
+               */
 
 
                osrfLogInfo( OSRF_LOG_MARK,  "[%s] service=%s, method=%s",