Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Feb 19, 2025
1 parent 7d77507 commit e8f8d85
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -3552,9 +3552,9 @@ inline void print_address_info(struct addrinfo *rp) {
sizeof(service), NI_NUMERICHOST | NI_NUMERICSERV);

if (result == 0) {
printf("Host: %s, Service: %s\n", host, service);
printf("Host: %s\n", host);
} else {
fprintf(stderr, "getnameinfo: %s\n", gai_strerror(result));
printf("getnameinfo: %s\n", gai_strerror(result));
}
}

Expand Down
17 changes: 13 additions & 4 deletions test/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8464,10 +8464,7 @@ TEST(MaxTimeoutTest, ContentStreamSSL) {
}
#endif

TEST(PerformanceTest, SimpleGetMethod) {
// auto host = "localhost";
// auto host = "::1";
auto host = "127.0.0.1";
void performance_test(const char *host) {
auto port = 1234;

Server svr;
Expand Down Expand Up @@ -8520,3 +8517,15 @@ TEST(PerformanceTest, SimpleGetMethod) {
ASSERT_LE(average_time, 3000);
}

TEST(PerformanceTest, localhost) {
performance_test("localhost");
}

TEST(PerformanceTest, IPv4) {
performance_test("127.0.0.1");
}

TEST(PerformanceTest, IPv6) {
performance_test("::1");
}

0 comments on commit e8f8d85

Please sign in to comment.