1
Temporary workaround for testsuite problem wherein serf looks up
2
'localhost' but then expects to be able to use it with an IPv6 socket.
3
I'm not sure of the details, but using 'ip6-localhost' everywhere works.
9
/* Server setup function(s)
12
-#define SERV_URL "http://localhost:" SERV_PORT_STR
13
+#define SERV_URL "http://ip6-localhost:" SERV_PORT_STR
15
static apr_status_t default_server_address(apr_sockaddr_t **address,
18
return apr_sockaddr_info_get(address,
19
- "localhost", APR_UNSPEC, SERV_PORT, 0,
20
+ "ip6-localhost", APR_UNSPEC, SERV_PORT, 0,
24
@@ -41,7 +41,7 @@ static apr_status_t default_proxy_addres
27
return apr_sockaddr_info_get(address,
28
- "localhost", APR_UNSPEC, PROXY_PORT, 0,
29
+ "ip6-localhost", APR_UNSPEC, PROXY_PORT, 0,
33
--- a/test/serf_request.c
34
+++ b/test/serf_request.c
35
@@ -65,7 +65,7 @@ int main(int argc, const char **argv)
36
hdrs_bkt = serf_bucket_request_get_headers(req_bkt);
38
/* FIXME: Shouldn't we be able to figure out the host ourselves? */
39
- serf_bucket_headers_setn(hdrs_bkt, "Host", "localhost");
40
+ serf_bucket_headers_setn(hdrs_bkt, "Host", "ip6-localhost");
41
serf_bucket_headers_setn(hdrs_bkt, "User-Agent",
42
"Serf/" SERF_VERSION_STRING);
44
--- a/test/test_context.c
45
+++ b/test/test_context.c
46
@@ -473,8 +473,8 @@ static void test_serf_setup_proxy(CuTest
47
apr_sockaddr_t *proxy_address;
49
test_server_message_t message_list[] = {
50
- {"GET http://localhost:" SERV_PORT_STR " HTTP/1.1" CRLF\
51
- "Host: localhost:" SERV_PORT_STR CRLF\
52
+ {"GET http://ip6-localhost:" SERV_PORT_STR " HTTP/1.1" CRLF\
53
+ "Host: ip6-localhost:" SERV_PORT_STR CRLF\
54
"Transfer-Encoding: chunked" CRLF\
57
--- a/test/test_serf.h
58
+++ b/test/test_serf.h
59
@@ -52,7 +52,7 @@ CuSuite *test_ssl(void);
61
#define CHUNKED_REQUEST(len, body)\
62
"GET / HTTP/1.1" CRLF\
63
- "Host: localhost:12345" CRLF\
64
+ "Host: ip6-localhost:12345" CRLF\
65
"Transfer-Encoding: chunked" CRLF\