]> granicus.if.org Git - php/commitdiff
Merged with main trunk 1.53/1.5.
authorHolger Zimmermann <holger@php.net>
Mon, 2 Jun 2003 17:14:10 +0000 (17:14 +0000)
committerHolger Zimmermann <holger@php.net>
Mon, 2 Jun 2003 17:14:10 +0000 (17:14 +0000)
sapi/pi3web/pi3web_sapi.c
sapi/pi3web/pi3web_sapi.h

index 09bb892777f1b1fe9c08c5473ffc25ffd066709c..bc25266ac5e85c5fe042baf0e7e08a003e91017e 100644 (file)
@@ -23,6 +23,8 @@
 
 /* $Id$ */
 
+#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
+
 #include "pi3web_sapi.h"
 #include "php.h"
 #include "php_main.h"
@@ -38,9 +40,7 @@
 #include "PiAPI.h"
 #include "Pi3API.h"
 
-#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION")
 #define PI3WEB_SERVER_VAR_BUF_SIZE 1024
-#define PI3WEB_POST_DATA_BUF 1024
 
 int IWasLoaded=0;
 
@@ -231,7 +231,7 @@ static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC)
        DWORD read_from_input=0;
        DWORD total_read=0;
 
-       if (SG(read_post_bytes) < lpCB->cbAvailable) {
+       if ((DWORD)SG(read_post_bytes) < lpCB->cbAvailable) {
                read_from_buf = MIN(lpCB->cbAvailable-SG(read_post_bytes), count_bytes);
                memcpy(buffer, lpCB->lpbData+SG(read_post_bytes), read_from_buf);
                total_read += read_from_buf;
@@ -250,7 +250,9 @@ static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC)
                }
                total_read += cbRead;
        }
-       SG(read_post_bytes) += total_read;
+       
+       /* removed after re-testing POST with Pi3Web 2.0.2 */
+       /* SG(read_post_bytes) += total_read; */
        return total_read;
 }
 
@@ -379,13 +381,11 @@ static sapi_module_struct pi3web_sapi_module = {
        sapi_pi3web_read_cookies,               /* read Cookies */
        sapi_pi3web_register_variables, /* register server variables */
        NULL,                                   /* Log message */
-       NULL,                                   /* Block interruptions */
-       NULL,                                   /* Unblock interruptions */     
 
        STANDARD_SAPI_MODULE_PROPERTIES
 };
 
-DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
+MODULE_API DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
 {
        zend_file_handle file_handle = {0};
        int iRet = PIAPI_COMPLETED;
@@ -454,7 +454,7 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
        return iRet;
 }
 
-BOOL PHP4_startup() {
+MODULE_API BOOL PHP4_startup() {
        tsrm_startup(1, 1, 0, NULL);
        sapi_startup(&pi3web_sapi_module);
        if (pi3web_sapi_module.startup) {
@@ -464,7 +464,7 @@ BOOL PHP4_startup() {
        return IWasLoaded;
 };
 
-BOOL PHP4_shutdown() {
+MODULE_API BOOL PHP4_shutdown() {
        if (pi3web_sapi_module.shutdown) {
                pi3web_sapi_module.shutdown(&pi3web_sapi_module);
        };
index 36e08e798206b2f807a6b239be8089a5075ea9c9..d1c38d744e7979d974567d2d098719826c3e865a 100644 (file)
@@ -4,7 +4,7 @@
 #ifdef PHP_WIN32
 #      include <windows.h>
 #      include <httpext.h>
-#      ifdef SAPI_EXPORTS
+#      ifdef PHP4PI3WEB_EXPORTS
 #              define MODULE_API __declspec(dllexport) 
 #      else
 #              define MODULE_API __declspec(dllimport) 
@@ -79,9 +79,9 @@ typedef struct _CONTROL_BLOCK {
 
 } CONTROL_BLOCK, *LPCONTROL_BLOCK;
 
-DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB);
-BOOL PHP4_startup();
-BOOL PHP4_shutdown();
+MODULE_API DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB);
+MODULE_API BOOL PHP4_startup();
+MODULE_API BOOL PHP4_shutdown();
 
 // the following type declaration is for the server side
 typedef DWORD ( * PFN_WRAPPERFUNC )( CONTROL_BLOCK *pCB );