git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@461 830e0280-6d2a-0410-9c65-932aecc39d9d
Michal Ludvig authored on 2010/12/23 23:01:32... | ... |
@@ -74,7 +74,8 @@ class Config(object): |
74 | 74 |
urlencoding_mode = "normal" |
75 | 75 |
log_target_prefix = "" |
76 | 76 |
reduced_redundancy = False |
77 |
- follow_symlinks=False |
|
77 |
+ follow_symlinks = False |
|
78 |
+ socket_timeout = 10 |
|
78 | 79 |
|
79 | 80 |
## Creating a singleton |
80 | 81 |
def __new__(self, configfile = None): |
... | ... |
@@ -22,6 +22,7 @@ import codecs |
22 | 22 |
import locale |
23 | 23 |
import subprocess |
24 | 24 |
import htmlentitydefs |
25 |
+import socket |
|
25 | 26 |
|
26 | 27 |
from copy import copy |
27 | 28 |
from optparse import OptionParser, Option, OptionValueError, IndentedHelpFormatter |
... | ... |
@@ -1906,9 +1907,12 @@ def main(): |
1906 | 1906 |
cfg.include.extend(patterns_list) |
1907 | 1907 |
cfg.debug_include.update(patterns_textual) |
1908 | 1908 |
|
1909 |
- ## Process --follow-symlinks |
|
1909 |
+ ## Process --follow-symlinks |
|
1910 | 1910 |
cfg.update_option("follow_symlinks", options.follow_symlinks) |
1911 | 1911 |
|
1912 |
+ ## Set socket read()/write() timeout |
|
1913 |
+ socket.setdefaulttimeout(cfg.socket_timeout) |
|
1914 |
+ |
|
1912 | 1915 |
if cfg.encrypt and cfg.gpg_passphrase == "": |
1913 | 1916 |
error(u"Encryption requested but no passphrase set in config file.") |
1914 | 1917 |
error(u"Please re-run 's3cmd --configure' and supply it.") |