#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_NETDB
+#include "php_http.h"
#include "SAPI.h"
#include "zend_ini.h"
#include "php_output.h"
#include "ext/standard/url.h"
-#include "php_http.h"
#include "php_http_api.h"
#include "php_http_url_api.h"
-#include "php_http_std_defs.h"
-
-#include "phpstr/phpstr.h"
-
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#elif defined(HAVE_NETDB_H)
-# include <netdb.h>
-#endif
ZEND_EXTERN_MODULE_GLOBALS(http);
furl.port = purl->port;
} else if (strncmp(furl.scheme, "http", 4)) {
#if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
- if (se = getservbyname(furl.scheme, "tcp")) {
+ if ((se = getservbyname(furl.scheme, "tcp"))) {
furl.port = se->s_port;
}
#endif
uint len = 0;
ulong idx = 0;
zval **data = NULL;
+ HashPosition pos;
if (!ht || !str) {
http_error(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid parameters");
return SUCCESS;
}
- FOREACH_HASH_KEYLENVAL(ht, key, len, idx, data) {
+ FOREACH_HASH_KEYLENVAL(pos, ht, key, len, idx, data) {
char *encoded_key;
int encoded_len;
phpstr new_prefix;