diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-01-15 09:04:47 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-01-15 09:04:47 +0000 |
| commit | c022939c8f3d5da91809019a2068ca7fd8c29c59 (patch) | |
| tree | 71464327732d42c26ade4b0d847f0272268c7813 /src/OptionHandlerImpl.h | |
| parent | c16b346bb9ba912b5fd2faa81865c8d5f22590a1 (diff) | |
2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now --all-proxy, --http-proxy, --https-proxy and --ftp-proxy
option accepts empty string "". When "" is given, it erases
previously defined proxy.
* doc/aria2c.1.txt
* src/OptionHandlerImpl.h
* src/usage_text.h
* test/OptionHandlerTest.cc
Diffstat (limited to 'src/OptionHandlerImpl.h')
| -rw-r--r-- | src/OptionHandlerImpl.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/OptionHandlerImpl.h b/src/OptionHandlerImpl.h index 3735956f..ded59c46 100644 --- a/src/OptionHandlerImpl.h +++ b/src/OptionHandlerImpl.h @@ -556,17 +556,21 @@ public: virtual void parseArg(Option& option, const std::string& optarg) { - Request req; - std::string url; - if(util::startsWith(optarg, "http://")) { - url = optarg; - } else { - url = "http://"+optarg; - } - if(req.setUrl(url)) { - option.put(_optName, url); + if(optarg.empty()) { + option.put(_optName, optarg); } else { - throw DL_ABORT_EX(_("unrecognized proxy format")); + Request req; + std::string url; + if(util::startsWith(optarg, "http://")) { + url = optarg; + } else { + url = "http://"+optarg; + } + if(req.setUrl(url)) { + option.put(_optName, url); + } else { + throw DL_ABORT_EX(_("unrecognized proxy format")); + } } } |
