}
+/* taken more or less directly from O'Reillly - Writing Apache Modules in Perl and C */
+apr_table_t* apacheParseCookies(request_rec *r) {
+
+ const char *data = ap_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);
+ 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);
+ }
+ }
+
+ return cookies;
+}
+
+
+
+
*/
int apacheError( char* msg, ... );
+/*
+ * Creates an apache table* of cookie name / value pairs
+ */
+apr_table_t* apacheParseCookies(request_rec *r);
+
#endif
char* a_l = NULL; /* request api level */
int isXML = 0;
int api_level = 1;
+ apr_table_t* cookies = NULL;
r->allowed |= (AP_METHOD_BIT << M_GET);
r->allowed |= (AP_METHOD_BIT << M_POST);
} 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, "service=%s, method=%s", service, method );
osrfAppSession* session = osrf_app_client_session_init(service);
int req_id = osrf_app_session_make_req( session, NULL, method, api_level, mparams );