+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#else
+# ifndef PHP_WIN32
+# include "php_config.h"
+# endif
+#endif
+
+#include "php.h"
+#include "php_http_std_defs.h"
+#include "phpstr/phpstr.h"
+#include "missing.h"
+
+#ifdef HTTP_WANT_SAPI
+# if PHP_API_VERSION > 20041225
+# define HTTP_HAVE_SAPI_RTIME
+# define HTTP_GET_REQUEST_TIME() sapi_get_request_time(TSRMLS_C)
+# else
+# define HTTP_GET_REQUEST_TIME() HTTP_G(request_time)
+# endif
+# include "SAPI.h"
+#endif
+
+#ifdef HTTP_WANT_NETDB
+# ifdef PHP_WIN32
+# define HTTP_HAVE_NETDB
+# include <winsock2.h>
+# elif defined(HAVE_NETDB_H)
+# define HTTP_HAVE_NETDB
+# include <netdb.h>
+# endif
+#endif
+
+#if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)