pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/net/libfetch/files
Module Name: pkgsrc
Committed By: wiz
Date: Thu Apr 16 08:32:12 UTC 2026
Modified Files:
pkgsrc/net/libfetch/files: http.c
Log Message:
libfetch: reduce diffs to src/
revision 1.6
date: 2024-09-01 17:07:31 +0200; author: christos; state: Exp; lines: +9 -7; commitid: g7m30PlS4W7Jb7oF;
PR/58656: RVP: Fix proxy authentication for https and when proxy does not
add any extra headers.
revision 1.5
date: 2024-02-02 23:19:05 +0100; author: christos; state: Exp; lines: +68 -21; commitid: WGGFqVnnZpItpUWE;
branches: 1.5.2;
Sync with pkgsrc and try to fix more memory corruption from PR/57179.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 pkgsrc/net/libfetch/files/http.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/net/libfetch/files/http.c
diff -u pkgsrc/net/libfetch/files/http.c:1.46 pkgsrc/net/libfetch/files/http.c:1.47
--- pkgsrc/net/libfetch/files/http.c:1.46 Thu Apr 16 08:20:45 2026
+++ pkgsrc/net/libfetch/files/http.c Thu Apr 16 08:32:12 2026
@@ -1,4 +1,4 @@
-/* $NetBSD: http.c,v 1.46 2026/04/16 08:20:45 wiz Exp $ */
+/* $NetBSD: http.c,v 1.47 2026/04/16 08:32:12 wiz Exp $ */
/*-
* Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
* Copyright (c) 2003 Thomas Klausner <wiz%NetBSD.org@localhost>
@@ -765,8 +765,15 @@ http_connect(struct url *URL, struct url
#endif
curl = (purl != NULL) ? purl : URL;
+ if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) {
+ URL = purl;
+ } else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) {
- if ((conn = fetch_cache_get(URL, af)) != NULL) {
+ /* XXX should set an error code */
+ return (NULL);
+ }
+
+ if ((conn = fetch_cache_get(curl, af)) != NULL) {
*cached = 1;
return (conn);
}
@@ -779,16 +786,18 @@ http_connect(struct url *URL, struct url
URL->host, URL->port);
http_cmd(conn, "Host: %s:%d\r\n",
URL->host, URL->port);
+ /* proxy authorization */
+ if (*purl->user || *purl->pwd)
+ http_basic_auth(conn, "Proxy-Authorization",
+ purl->user, purl->pwd);
+ else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && *p != '\0')
+ http_authorize(conn, "Proxy-Authorization", p);
http_cmd(conn, "\r\n");
if (http_get_reply(conn) != HTTP_OK) {
http_seterr(conn->err);
goto ouch;
}
/* Read and discard the rest of the proxy response */
- if (fetch_getln(conn) < 0) {
- fetch_syserr();
- goto ouch;
- }
do {
switch ((h = http_next_header(conn, &p))) {
case hdr_syserror:
Home |
Main Index |
Thread Index |
Old Index