Skip to content
Browse files

* s3cmd: Set 10s socket timeout for read()/write().

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@461 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 1ba1f69 commit 0222ce4f82f663f38ee89eff3708bab7d66562d1 @mludvig mludvig committed Dec 23, 2010
Showing with 9 additions and 2 deletions.
  1. +1 −0 ChangeLog
  2. +1 −0 NEWS
  3. +2 −1 S3/Config.py
  4. +5 −1 s3cmd
View
1 ChangeLog
@@ -1,5 +1,6 @@
2010-12-24 Michal Ludvig <mludvig@logix.net.nz>
+ * s3cmd: Set 10s socket timeout for read()/write().
* s3cmd: Added --(no-)check-md5 for [sync].
* run-tests.py, testsuite.tar.gz: Added testsuite for
the above.
View
1 NEWS
@@ -1,6 +1,7 @@
s3cmd 1.0.0
===========
* [sync] now supports --no-check-md5
+* Network connections now have 10s timeout
s3cmd 1.0.0-rc2 - 2010-12-09
===============
View
3 S3/Config.py
@@ -74,7 +74,8 @@ class Config(object):
urlencoding_mode = "normal"
log_target_prefix = ""
reduced_redundancy = False
- follow_symlinks=False
+ follow_symlinks = False
+ socket_timeout = 10
## Creating a singleton
def __new__(self, configfile = None):
View
6 s3cmd
@@ -22,6 +22,7 @@ import codecs
import locale
import subprocess
import htmlentitydefs
+import socket
from copy import copy
from optparse import OptionParser, Option, OptionValueError, IndentedHelpFormatter
@@ -1906,9 +1907,12 @@ def main():
cfg.include.extend(patterns_list)
cfg.debug_include.update(patterns_textual)
- ## Process --follow-symlinks
+ ## Process --follow-symlinks
cfg.update_option("follow_symlinks", options.follow_symlinks)
+ ## Set socket read()/write() timeout
+ socket.setdefaulttimeout(cfg.socket_timeout)
+
if cfg.encrypt and cfg.gpg_passphrase == "":
error(u"Encryption requested but no passphrase set in config file.")
error(u"Please re-run 's3cmd --configure' and supply it.")

0 comments on commit 0222ce4

Please sign in to comment.
Something went wrong with that request. Please try again.