1 Star 0 Fork 22

lZx/third_party_cups

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fix-httpAddrGetList-test-case-fail.patch 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
张攀 提交于 2023-06-09 06:55 . fix build error
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lzzxxxx/third_party_cups.git
git@gitee.com:lzzxxxx/third_party_cups.git
lzzxxxx
third_party_cups
third_party_cups
master

搜索帮助