- case PROXY_NONE:
- default:
- break;
-
- case PROXY_EXEC:
- if(!space || !*space) {
- logger(LOG_ERR, "Argument expected for proxy type exec!");
- free(proxy);
- return false;
- }
- proxyhost = xstrdup(space);
- break;
-
- case PROXY_SOCKS4:
- case PROXY_SOCKS4A:
- case PROXY_SOCKS5:
- case PROXY_HTTP:
- proxyhost = space;
- if(space && (space = strchr(space, ' ')))
- *space++ = 0, proxyport = space;
- if(space && (space = strchr(space, ' ')))
- *space++ = 0, proxyuser = space;
- if(space && (space = strchr(space, ' ')))
- *space++ = 0, proxypass = space;
- if(!proxyhost || !*proxyhost || !proxyport || !*proxyport) {
- logger(LOG_ERR, "Host and port argument expected for proxy!");
- free(proxy);
- return false;
- }
- proxyhost = xstrdup(proxyhost);
- proxyport = xstrdup(proxyport);
- if(proxyuser && *proxyuser)
- proxyuser = xstrdup(proxyuser);
- if(proxypass && *proxypass)
- proxypass = xstrdup(proxypass);
- break;
+ case PROXY_NONE:
+ default:
+ break;
+
+ case PROXY_EXEC:
+ if(!space || !*space) {
+ logger(LOG_ERR, "Argument expected for proxy type exec!");
+ free(proxy);
+ return false;
+ }
+
+ proxyhost = xstrdup(space);
+ break;
+
+ case PROXY_SOCKS4:
+ case PROXY_SOCKS4A:
+ case PROXY_SOCKS5:
+ case PROXY_HTTP:
+ proxyhost = space;
+
+ if(space && (space = strchr(space, ' '))) {
+ *space++ = 0, proxyport = space;
+ }
+
+ if(space && (space = strchr(space, ' '))) {
+ *space++ = 0, proxyuser = space;
+ }
+
+ if(space && (space = strchr(space, ' '))) {
+ *space++ = 0, proxypass = space;
+ }
+
+ if(!proxyhost || !*proxyhost || !proxyport || !*proxyport) {
+ logger(LOG_ERR, "Host and port argument expected for proxy!");
+ free(proxy);
+ return false;
+ }
+
+ proxyhost = xstrdup(proxyhost);
+ proxyport = xstrdup(proxyport);
+
+ if(proxyuser && *proxyuser) {
+ proxyuser = xstrdup(proxyuser);
+ }
+
+ if(proxypass && *proxypass) {
+ proxypass = xstrdup(proxypass);
+ }
+
+ break;