projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
* I always forget to update that...
[m6w6/ext-http]
/
http_api.c
diff --git
a/http_api.c
b/http_api.c
index 48387837c4fd068ed13f87298389230d468feba6..af42cd5e641cb68a785d72176a967899e78abd92 100644
(file)
--- a/
http_api.c
+++ b/
http_api.c
@@
-23,7
+23,12
@@
#endif
#include <ctype.h>
#endif
#include <ctype.h>
-#include <netdb.h>
+
+#ifdef PHP_WIN32
+# include <winsock2.h>
+#elif defined(HAVE_NETDB_H)
+# include <netdb.h>
+#endif
#include "php.h"
#include "php_version.h"
#include "php.h"
#include "php_version.h"
@@
-887,7
+892,7
@@
PHP_HTTP_API char *_http_absolute_uri_ex(
const char *host, size_t host_len,
unsigned port TSRMLS_DC)
{
const char *host, size_t host_len,
unsigned port TSRMLS_DC)
{
-#if
def ZEND_ENGINE_2
+#if
defined(PHP_WIN32) || defined(HAVE_NETDB_H)
struct servent *se;
#endif
php_url *purl, furl = {NULL};
struct servent *se;
#endif
php_url *purl, furl = {NULL};
@@
-918,7
+923,7
@@
PHP_HTTP_API char *_http_absolute_uri_ex(
furl.scheme = scheme = estrdup(proto);
} else if (purl->scheme) {
furl.scheme = purl->scheme;
furl.scheme = scheme = estrdup(proto);
} else if (purl->scheme) {
furl.scheme = purl->scheme;
-#if
def ZEND_ENGINE_2
+#if
defined(PHP_WIN32) || defined(HAVE_NETDB_H)
} else if (port && (se = getservbyport(port, "tcp"))) {
furl.scheme = (scheme = estrdup(se->s_name));
#endif
} else if (port && (se = getservbyport(port, "tcp"))) {
furl.scheme = (scheme = estrdup(se->s_name));
#endif
@@
-931,7
+936,7
@@
PHP_HTTP_API char *_http_absolute_uri_ex(
} else if (purl->port) {
furl.port = purl->port;
} else if (strncmp(furl.scheme, "http", 4)) {
} else if (purl->port) {
furl.port = purl->port;
} else if (strncmp(furl.scheme, "http", 4)) {
-#if
def ZEND_ENGINE_2
+#if
defined(PHP_WIN32) || defined(HAVE_NETDB_H)
if (se = getservbyname(furl.scheme, "tcp")) {
furl.port = se->s_port;
} else
if (se = getservbyname(furl.scheme, "tcp")) {
furl.port = se->s_port;
} else