Permalink
Browse files

Merge branch 'stable'

  • Loading branch information...
2 parents 9d87535 + ca76488 commit 8cde073a7311c75a9ec29e8a97d9c9b965944308 @meebey committed May 17, 2012
Showing with 19 additions and 5 deletions.
  1. +1 −1 lib/SmartIrc4net
  2. +6 −2 src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
  3. +12 −2 src/Engine/Config/ProxySettings.cs
Submodule SmartIrc4net updated from d86ee0 to 716d1e
@@ -2164,8 +2164,12 @@ private void ApplyConfig(UserConfig config, ServerModel server)
_IrcClient.ProxyType = ircProxyType;
_IrcClient.ProxyHost = proxy.Address.Host;
_IrcClient.ProxyPort = proxy.Address.Port;
- _IrcClient.ProxyUsername = proxySettings.ProxyUsername;
- _IrcClient.ProxyPassword = proxySettings.ProxyPassword;
+ if (!String.IsNullOrEmpty(proxySettings.ProxyUsername)) {
+ _IrcClient.ProxyUsername = proxySettings.ProxyUsername;
+ }
+ if (!String.IsNullOrEmpty(proxySettings.ProxyPassword)) {
+ _IrcClient.ProxyPassword = proxySettings.ProxyPassword;
+ }
}
if (server != null) {
@@ -60,6 +60,16 @@ public WebProxy GetWebProxy(Uri destination)
}
if (SystemWebProxy == null) {
+ if (DefaultWebProxy.Address.Scheme.StartsWith("socks") &&
+ destination.Scheme.StartsWith("http")) {
+#if LOG4NET
+ f_Logger.DebugFormat("GetWebProxy(<{0}>): ignoring " +
+ "SOCKS proxy for HTTP destination: {1}",
+ destination, DefaultWebProxy.Address);
+#endif
+ return null;
+ }
+
#if LOG4NET
f_Logger.DebugFormat("GetWebProxy(<{0}>): returning default proxy: {1}",
destination, DefaultWebProxy.Address);
@@ -139,9 +149,9 @@ public void ApplyConfig(UserConfig config)
DefaultWebProxy = null;
SystemWebProxy = proxy;
break;
- case ProxyType.Http:
+ default:
var uriBuilder = new UriBuilder();
- uriBuilder.Scheme = "http";
+ uriBuilder.Scheme = ProxyType.ToString().ToLower();
uriBuilder.Host = ProxyHostname;
uriBuilder.Port = ProxyPort;
uriBuilder.UserName = ProxyUsername;

0 comments on commit 8cde073

Please sign in to comment.