1From 079c00aac0db4d95383cf73be73e641ff26ebfc6 Mon Sep 17 00:00:00 2001 2From: zhangpan <zhangpan103@h-partners.com> 3Date: Fri, 9 Jun 2023 11:04:18 +0800 4Subject: [PATCH] fix httpAddrGetList test case fail 5 6--- 7 cups/testhttp.c | 7 ++++--- 8 1 file changed, 4 insertions(+), 3 deletions(-) 9 10diff --git a/cups/testhttp.c b/cups/testhttp.c 11index 313e4bb..f446d65 100644 12--- a/cups/testhttp.c 13+++ b/cups/testhttp.c 14@@ -14,7 +14,7 @@ 15 */ 16 17 #include "cups-private.h" 18- 19+#include <unistd.h> 20 21 /* 22 * Types and structures... 23@@ -231,7 +231,8 @@ main(int argc, /* I - Number of command-line arguments */ 24 char scheme[HTTP_MAX_URI], /* Scheme from URI */ 25 hostname[HTTP_MAX_URI], /* Hostname from URI */ 26 username[HTTP_MAX_URI], /* Username:password from URI */ 27- resource[HTTP_MAX_URI]; /* Resource from URI */ 28+ resource[HTTP_MAX_URI], /* Resource from URI */ 29+ localhostname[HTTP_MAX_URI]; /* gethostname */ 30 int port; /* Port number from URI */ 31 http_uri_status_t uri_status; /* Status of URI separation */ 32 http_addrlist_t *addrlist, /* Address list */ 33@@ -391,7 +392,7 @@ main(int argc, /* I - Number of command-line arguments */ 34 35 printf("httpAddrGetList(%s): ", hostname); 36 37- addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL); 38+ addrlist = httpAddrGetList(gethostname(localhostname, sizeof(localhostname)), AF_UNSPEC, NULL); 39 if (addrlist) 40 { 41 for (i = 0, addr = addrlist; addr; i ++, addr = addr->next) 42-- 432.33.0 44 45