Import of pkgsrc-2014Q1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# $NetBSD: Makefile,v 1.47 2013/02/06 23:20:50 jperkin Exp $
|
||||
# $NetBSD: Makefile,v 1.51 2014/02/12 23:18:22 tron Exp $
|
||||
#
|
||||
|
||||
DISTNAME= libfetch-2.34
|
||||
DISTNAME= libfetch-2.36
|
||||
PKGREVISION= 1
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= # empty
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $NetBSD: buildlink3.mk,v 1.10 2013/04/06 13:46:33 rodent Exp $
|
||||
# $NetBSD: buildlink3.mk,v 1.11 2014/02/12 23:18:22 tron Exp $
|
||||
|
||||
BUILDLINK_TREE+= libfetch
|
||||
|
||||
@@ -8,7 +8,7 @@ LIBFETCH_BUILDLINK3_MK:=
|
||||
BUILDLINK_DEPMETHOD.libfetch?= build
|
||||
|
||||
BUILDLINK_API_DEPENDS.libfetch+= libfetch>=2.28
|
||||
BUILDLINK_ABI_DEPENDS.libfetch?= libfetch>=2.34nb1
|
||||
BUILDLINK_ABI_DEPENDS.libfetch?= libfetch>=2.36nb1
|
||||
BUILDLINK_PKGSRCDIR.libfetch?= ../../net/libfetch
|
||||
|
||||
pkgbase := libfetch
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.5 2010/02/24 22:00:51 joerg Exp $
|
||||
# $NetBSD: Makefile,v 1.7 2013/10/03 01:25:51 joerg Exp $
|
||||
|
||||
LIB= fetch
|
||||
SRCS= fetch.c common.c ftp.c http.c file.c
|
||||
@@ -13,7 +13,7 @@ MKPROFILE= no
|
||||
.include <bsd.own.mk>
|
||||
|
||||
CPPFLAGS+= -I.
|
||||
CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES
|
||||
CPPFLAGS+= -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64
|
||||
|
||||
FETCH_WITH_INET6?= no
|
||||
FETCH_WITH_OPENSSL?= no
|
||||
@@ -32,11 +32,11 @@ CPPFLAGS+= -DFTP_COMBINE_CWDS
|
||||
WARNS?= 4
|
||||
|
||||
ftperr.h: ${.CURDIR}/ftp.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh
|
||||
${.CURDIR}/errlist.sh ftp_errlist FTP \
|
||||
sh ${.CURDIR}/errlist.sh ftp_errlist FTP \
|
||||
${.CURDIR}/ftp.errors > ${.TARGET}
|
||||
|
||||
httperr.h: ${.CURDIR}/http.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh
|
||||
${.CURDIR}/errlist.sh http_errlist HTTP \
|
||||
sh ${.CURDIR}/errlist.sh http_errlist HTTP \
|
||||
${.CURDIR}/http.errors > ${.TARGET}
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: common.c,v 1.27 2010/06/13 21:38:09 joerg Exp $ */
|
||||
/* $NetBSD: common.c,v 1.29 2014/01/08 20:25:34 joerg Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
|
||||
* Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg@NetBSD.org>
|
||||
@@ -431,7 +431,7 @@ fetch_cache_put(conn_t *conn, int (*closecb)(conn_t *))
|
||||
* Enable SSL on a connection.
|
||||
*/
|
||||
int
|
||||
fetch_ssl(conn_t *conn, int verbose)
|
||||
fetch_ssl(conn_t *conn, const struct url *URL, int verbose)
|
||||
{
|
||||
|
||||
#ifdef WITH_SSL
|
||||
@@ -453,6 +453,14 @@ fetch_ssl(conn_t *conn, int verbose)
|
||||
return (-1);
|
||||
}
|
||||
SSL_set_fd(conn->ssl, conn->sd);
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
|
||||
if (!SSL_set_tlsext_host_name(conn->ssl, (char *)(uintptr_t)URL->host)) {
|
||||
fprintf(stderr,
|
||||
"TLS server name indication extension failed for host %s\n",
|
||||
URL->host);
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
if (SSL_connect(conn->ssl) == -1){
|
||||
ERR_print_errors_fp(stderr);
|
||||
return (-1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: common.h,v 1.21 2013/02/10 12:33:22 obache Exp $ */
|
||||
/* $NetBSD: common.h,v 1.23 2014/01/08 20:25:34 joerg Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
|
||||
* All rights reserved.
|
||||
@@ -105,7 +105,7 @@ conn_t *fetch_cache_get(const struct url *, int);
|
||||
void fetch_cache_put(conn_t *, int (*)(conn_t *));
|
||||
conn_t *fetch_connect(struct url *, int, int);
|
||||
conn_t *fetch_reopen(int);
|
||||
int fetch_ssl(conn_t *, int);
|
||||
int fetch_ssl(conn_t *, const struct url *, int);
|
||||
ssize_t fetch_read(conn_t *, char *, size_t);
|
||||
int fetch_getln(conn_t *);
|
||||
ssize_t fetch_write(conn_t *, const void *, size_t);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD: fetch.3,v 1.64 2007/12/18 11:03:26 des Exp $
|
||||
.\" $NetBSD: fetch.3,v 1.15 2010/01/22 13:56:45 wiz Exp $
|
||||
.\" $NetBSD: fetch.3,v 1.16 2013/07/20 21:50:52 wiz Exp $
|
||||
.\"
|
||||
.Dd January 22, 2010
|
||||
.Dt FETCH 3
|
||||
@@ -731,22 +731,22 @@ library first appeared in
|
||||
The
|
||||
.Nm fetch
|
||||
library was mostly written by
|
||||
.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org
|
||||
.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org
|
||||
with numerous suggestions from
|
||||
.An Jordan K. Hubbard Aq jkh@FreeBSD.org ,
|
||||
.An Eugene Skepner Aq eu@qub.com
|
||||
.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org ,
|
||||
.An Eugene Skepner Aq Mt eu@qub.com
|
||||
and other
|
||||
.Fx
|
||||
developers.
|
||||
It replaces the older
|
||||
.Nm ftpio
|
||||
library written by
|
||||
.An Poul-Henning Kamp Aq phk@FreeBSD.org
|
||||
.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
|
||||
and
|
||||
.An Jordan K. Hubbard Aq jkh@FreeBSD.org .
|
||||
.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org .
|
||||
.Pp
|
||||
This manual page was written by
|
||||
.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
|
||||
.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
|
||||
.Sh BUGS
|
||||
Some parts of the library are not yet implemented.
|
||||
The most notable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ftp.c,v 1.43 2012/10/15 22:43:24 joerg Exp $ */
|
||||
/* $NetBSD: ftp.c,v 1.44 2014/01/07 23:25:12 joerg Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
|
||||
* Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger <joerg@NetBSD.org>
|
||||
@@ -201,6 +201,7 @@ ftp_chkerr(conn_t *conn)
|
||||
/*
|
||||
* Send a command and check reply
|
||||
*/
|
||||
LIBFETCH_PRINTFLIKE(2, 3)
|
||||
static int
|
||||
ftp_cmd(conn_t *conn, const char *fmt, ...)
|
||||
{
|
||||
@@ -485,7 +486,7 @@ ftp_stat(conn_t *conn, const char *file, struct url_stat *us)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
e = ftp_cmd(conn, "SIZE %.*s\r\n", filenamelen, filename);
|
||||
e = ftp_cmd(conn, "SIZE %.*s\r\n", (int)filenamelen, filename);
|
||||
if (e != FTP_FILE_STATUS) {
|
||||
ftp_seterr(e);
|
||||
return (-1);
|
||||
@@ -502,7 +503,7 @@ ftp_stat(conn_t *conn, const char *file, struct url_stat *us)
|
||||
if (us->size == 0)
|
||||
us->size = -1;
|
||||
|
||||
e = ftp_cmd(conn, "MDTM %.*s\r\n", filenamelen, filename);
|
||||
e = ftp_cmd(conn, "MDTM %.*s\r\n", (int)filenamelen, filename);
|
||||
if (e != FTP_FILE_STATUS) {
|
||||
ftp_seterr(e);
|
||||
return (-1);
|
||||
@@ -845,7 +846,7 @@ retry_mode:
|
||||
e = ftp_cmd(conn, "%s%s%s\r\n", oper, *op_arg ? " " : "", op_arg);
|
||||
else
|
||||
e = ftp_cmd(conn, "%s %.*s\r\n", oper,
|
||||
filenamelen, filename);
|
||||
(int)filenamelen, filename);
|
||||
if (e != FTP_CONNECTION_ALREADY_OPEN && e != FTP_OPEN_DATA_CONNECTION)
|
||||
goto ouch;
|
||||
|
||||
@@ -946,7 +947,7 @@ retry_mode:
|
||||
e = ftp_cmd(conn, "%s%s%s\r\n", oper, *op_arg ? " " : "", op_arg);
|
||||
else
|
||||
e = ftp_cmd(conn, "%s %.*s\r\n", oper,
|
||||
filenamelen, filename);
|
||||
(int)filenamelen, filename);
|
||||
if (e != FTP_CONNECTION_ALREADY_OPEN && e != FTP_OPEN_DATA_CONNECTION)
|
||||
goto ouch;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: http.c,v 1.32 2012/04/07 15:27:21 joerg Exp $ */
|
||||
/* $NetBSD: http.c,v 1.35 2014/01/08 20:25:34 joerg Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav
|
||||
* Copyright (c) 2003 Thomas Klausner <wiz@NetBSD.org>
|
||||
@@ -63,8 +63,12 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(__linux__) || defined(__MINT__)
|
||||
#if defined(__linux__) || defined(__MINT__) || defined(__FreeBSD_kernel__)
|
||||
/* Keep this down to Linux or MiNT, it can create surprises elsewhere. */
|
||||
/*
|
||||
__FreeBSD_kernel__ is defined for GNU/kFreeBSD.
|
||||
See http://glibc-bsd.alioth.debian.org/porting/PORTING .
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
@@ -405,6 +409,7 @@ static struct {
|
||||
/*
|
||||
* Send a formatted line; optionally echo to terminal
|
||||
*/
|
||||
LIBFETCH_PRINTFLIKE(2, 3)
|
||||
static int
|
||||
http_cmd(conn_t *conn, const char *fmt, ...)
|
||||
{
|
||||
@@ -747,7 +752,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached)
|
||||
/* fetch_connect() has already set an error code */
|
||||
return (NULL);
|
||||
if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 &&
|
||||
fetch_ssl(conn, verbose) == -1) {
|
||||
fetch_ssl(conn, URL, verbose) == -1) {
|
||||
fetch_close(conn);
|
||||
/* grrr */
|
||||
#ifdef EAUTH
|
||||
|
||||
Reference in New Issue
Block a user