diff options
author | Sascha Schumann <sas@php.net> | 1999-09-25 16:51:18 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-09-25 16:51:18 +0000 |
commit | 104209a32880e4d2403fa01f4e2aea0aa08fb77c (patch) | |
tree | 12c42651204f2f90474092dd4d0c4e19fa4f18dd | |
parent | 091e91c051612b1b33199f9f43df1df25fb92ed3 (diff) | |
download | php-git-104209a32880e4d2403fa01f4e2aea0aa08fb77c.tar.gz |
* cleanup
* make cookies work
-rw-r--r-- | aolserver.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/aolserver.c b/aolserver.c index beb27b4bd5..ecc9d5e839 100644 --- a/aolserver.c +++ b/aolserver.c @@ -18,7 +18,10 @@ /* $Id$ */ +/* conflict between PHP and aolserver */ +#define Debug php_Debug #include "php.h" +#undef Debug #ifdef HAVE_AOLSERVER @@ -27,20 +30,10 @@ #include "SAPI.h" #include "main.h" -/* conflict between PHP and aolserver */ -#define Debug DEBUG_UNUSED #include "ns.h" -#undef Debug #include "php_version.h" -#if 0 -#define HERE \ - Ns_Log(Notice, "in %s:%d", __FUNCTION__, __LINE__); -#else -#define HERE -#endif - int Ns_ModuleVersion = 1; typedef struct { @@ -60,7 +53,6 @@ php_ns_sapi_ub_write(const char *str, uint str_length) php_ns_context *ctx; SLS_FETCH(); - HERE; ctx = (php_ns_context *) SG(server_context); Ns_DStringInit(&dstr); @@ -129,8 +121,17 @@ php_ns_sapi_read_post(char *buf, uint count_bytes SLS_DC) static char * php_ns_sapi_read_cookies(SLS_D) { - HERE; - return NULL; + Ns_Set *headers; + char *http_cookie; + php_ns_context *ctx = (php_ns_context *) SG(server_context); + + headers = Ns_ConnHeaders(conn); + + if(headers) { + http_cookie = Ns_SetGet(headers, "HTTP_COOKIE"); + } + + return http_cookie; } static sapi_module_struct sapi_module = { @@ -161,8 +162,6 @@ php_ns_module_main(php_ns_context *ctx SLS_DC) ELS_FETCH(); PLS_FETCH(); - HERE; - file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = SG(request_info).path_translated; @@ -179,7 +178,6 @@ php_ns_request_ctor(php_ns_context *ctx SLS_DC) char *server; Ns_DString ds; char *root; - HERE; server = Ns_ConnServer(ctx->conn); @@ -204,8 +202,6 @@ php_ns_request_ctor(php_ns_context *ctx SLS_DC) static void php_ns_request_dtor(php_ns_context *ctx SLS_DC) { - HERE; - free(SG(request_info).path_translated); Ns_DStringFree(&ctx->content_type); } @@ -217,7 +213,6 @@ php_ns_request_handler(void *context, Ns_Conn *conn) int status = NS_OK; SLS_FETCH(); - HERE; ctx->conn = conn; php_ns_request_ctor(ctx SLS_CC); @@ -279,7 +274,6 @@ php_ns_server_shutdown(void *context) { php_ns_context *ctx = (php_ns_context *) context; - HERE; ctx->sapi_module->shutdown(ctx->sapi_module); sapi_shutdown(); tsrm_shutdown(); @@ -289,7 +283,6 @@ php_ns_server_shutdown(void *context) free(ctx); } - int Ns_ModuleInit(char *server, char *module) { php_ns_context *ctx; |