Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2009 02:07:41 +0000 (UTC)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r192073 - stable/7/usr.bin/fetch
Message-ID:  <200905140207.n4E27fHo073613@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <fetch.h>
 
 #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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905140207.n4E27fHo073613>