From owner-svn-src-stable@FreeBSD.ORG Thu May 14 02:07:41 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7251106564A; Thu, 14 May 2009 02:07:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAF3E8FC0C; Thu, 14 May 2009 02:07:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4E27flZ073614; Thu, 14 May 2009 02:07:41 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4E27fHo073613; Thu, 14 May 2009 02:07:41 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200905140207.n4E27fHo073613@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 14 May 2009 02:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192073 - stable/7/usr.bin/fetch X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2009 02:07:42 -0000 Author: des Date: Thu May 14 02:07:41 2009 New Revision: 192073 URL: http://svn.freebsd.org/changeset/base/192073 Log: MFC 185912: Apply the same defaults to HTTPS as to HTTP. MFC 187361: Fix FTP / HTTP timeouts Modified: stable/7/usr.bin/fetch/ (props changed) stable/7/usr.bin/fetch/fetch.c Modified: stable/7/usr.bin/fetch/fetch.c ============================================================================== --- stable/7/usr.bin/fetch/fetch.c Thu May 14 02:00:50 2009 (r192072) +++ stable/7/usr.bin/fetch/fetch.c Thu May 14 02:07:41 2009 (r192073) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #define MINBUFSIZE 4096 +#define TIMEOUT 120 /* Option flags */ int A_flag; /* -A: do not follow 302 redirects */ @@ -75,7 +76,7 @@ int R_flag; /* -R: don't delete part int r_flag; /* -r: restart previously interrupted transfer */ off_t S_size; /* -S: require size to match */ int s_flag; /* -s: show size, don't fetch */ -long T_secs = 120; /* -T: transfer timeout in seconds */ +long T_secs; /* -T: transfer timeout in seconds */ int t_flag; /*! -t: workaround TCP bug */ int U_flag; /* -U: do not use high ports */ int v_level = 1; /* -v: verbosity level */ @@ -88,8 +89,8 @@ int sigalrm; /* SIGALRM received */ int siginfo; /* SIGINFO received */ int sigint; /* SIGINT received */ -long ftp_timeout; /* default timeout for FTP transfers */ -long http_timeout; /* default timeout for HTTP transfers */ +long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ +long http_timeout = TIMEOUT; /* default timeout for HTTP transfers */ char *buf; /* transfer buffer */ @@ -376,7 +377,8 @@ fetch(char *URL, const char *path) } /* HTTP specific flags */ - if (strcmp(url->scheme, SCHEME_HTTP) == 0) { + if (strcmp(url->scheme, SCHEME_HTTP) == 0 || + strcmp(url->scheme, SCHEME_HTTPS) == 0) { if (d_flag) strcat(flags, "d"); if (A_flag)