* cpp stuff
[m6w6/ext-http] / http.c
diff --git a/http.c b/http.c
index fdeb84f35973d91b24d362ac4302e617b980232f..43f15461e684ea794ea6e386c4644836bd5378ee 100644 (file)
--- a/http.c
+++ b/http.c
 
 /* $Id$ */
 
-#define _WINSOCKAPI_
-#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
 #endif
 
+#ifdef HTTP_HAVE_CURL
+#      ifdef PHP_WIN32
+#              define _WINSOCKAPI_
+#              include <winsock2.h>
+#              include <sys/types.h>
+#      endif
+#      include <curl/curl.h>
+#endif
+
 #include "php.h"
 #include "php_ini.h"
 #include "snprintf.h"
 #endif
 
 #ifdef HTTP_HAVE_CURL
-
-#      ifdef PHP_WIN32
-#              include <winsock2.h>
-#              include <sys/types.h>
-#      endif
-
-#      include <curl/curl.h>
-
 /* {{{ ARG_INFO */
 #      ifdef ZEND_BEGIN_ARG_INFO
 ZEND_BEGIN_ARG_INFO(http_request_info_ref_3, 0)
@@ -338,7 +337,8 @@ zend_function_entry httpi_request_class_methods[] = {
        PHP_ME(HTTPi_Request, send, NULL, ZEND_ACC_PUBLIC)
 
        PHP_ME(HTTPi_Request, getResponseData, NULL, ZEND_ACC_PUBLIC)
-       PHP_ME(HTTPi_Request, getResponseHeaders, NULL, ZEND_ACC_PUBLIC)
+       PHP_ME(HTTPi_Request, getResponseHeader, NULL, ZEND_ACC_PUBLIC)
+       PHP_ME(HTTPi_Request, getResponseCode, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(HTTPi_Request, getResponseBody, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(HTTPi_Request, getResponseInfo, NULL, ZEND_ACC_PUBLIC)
 
@@ -416,7 +416,9 @@ PHP_INI_MH(update_allowed_methods)
 }
 
 PHP_INI_BEGIN()
-       STD_PHP_INI_ENTRY("http.allowed_methods", "OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT", PHP_INI_ALL, update_allowed_methods, allowed_methods, zend_http_globals, http_globals)
+       STD_PHP_INI_ENTRY("http.allowed_methods", 
+               "OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK", 
+               PHP_INI_ALL, update_allowed_methods, allowed_methods, zend_http_globals, http_globals)
 PHP_INI_END()
 /* }}} */
 
@@ -478,6 +480,7 @@ PHP_RSHUTDOWN_FUNCTION(http)
                efree(HTTP_G(ctype));
                HTTP_G(ctype) = NULL;
        }
+
 #ifdef HTTP_HAVE_CURL
        if (HTTP_G(curlbuf).data) {
                efree(HTTP_G(curlbuf).data);
@@ -486,6 +489,7 @@ PHP_RSHUTDOWN_FUNCTION(http)
                HTTP_G(curlbuf).free = 0;
        }
 #endif
+
        return SUCCESS;
 }
 /* }}} */