third_party_cups/fix-httpAddrGetList-test-case-fail.patch
2023-06-09 06:55:30 +00:00

45 lines
1.4 KiB
Diff

From 079c00aac0db4d95383cf73be73e641ff26ebfc6 Mon Sep 17 00:00:00 2001
From: zhangpan <zhangpan103@h-partners.com>
Date: Fri, 9 Jun 2023 11:04:18 +0800
Subject: [PATCH] fix httpAddrGetList test case fail
---
cups/testhttp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cups/testhttp.c b/cups/testhttp.c
index 313e4bb..f446d65 100644
--- a/cups/testhttp.c
+++ b/cups/testhttp.c
@@ -14,7 +14,7 @@
*/
#include "cups-private.h"
-
+#include <unistd.h>
/*
* Types and structures...
@@ -231,7 +231,8 @@ main(int argc, /* I - Number of command-line arguments */
char scheme[HTTP_MAX_URI], /* Scheme from URI */
hostname[HTTP_MAX_URI], /* Hostname from URI */
username[HTTP_MAX_URI], /* Username:password from URI */
- resource[HTTP_MAX_URI]; /* Resource from URI */
+ resource[HTTP_MAX_URI], /* Resource from URI */
+ localhostname[HTTP_MAX_URI]; /* gethostname */
int port; /* Port number from URI */
http_uri_status_t uri_status; /* Status of URI separation */
http_addrlist_t *addrlist, /* Address list */
@@ -391,7 +392,7 @@ main(int argc, /* I - Number of command-line arguments */
printf("httpAddrGetList(%s): ", hostname);
- addrlist = httpAddrGetList(hostname, AF_UNSPEC, NULL);
+ addrlist = httpAddrGetList(gethostname(localhostname, sizeof(localhostname)), AF_UNSPEC, NULL);
if (addrlist)
{
for (i = 0, addr = addrlist; addr; i ++, addr = addr->next)
--
2.33.0