summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-05-04 18:53:31 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-05-04 18:53:31 +0200
commit66892eb133865ec02faa8e64cdfa2f867f9e1e87 (patch)
tree945f4a9c1c7335f3cddaf58d381b8a66610173fa /sys/src
parent4e665c8662d6baa40b41afa6e0ffd2fa4781b0a0 (diff)
webfs: fix "fd out of range" error message
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/cmd/webfs/http.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c
index 6cb8267c5..6c913fae0 100644
--- a/sys/src/cmd/webfs/http.c
+++ b/sys/src/cmd/webfs/http.c
@@ -122,14 +122,15 @@ hdial(Url *u)
snprint(addr, sizeof(addr), "tcp!%s!%s",
proxy->host, proxy->port ? proxy->port : proxy->scheme);
- if((fd = dial(addr, 0, 0, &ctl)) >= 0){
- if(proxy){
- if(strcmp(proxy->scheme, "https") == 0)
- fd = tlswrap(fd, proxy->host);
- } else {
- if(strcmp(u->scheme, "https") == 0)
- fd = tlswrap(fd, u->host);
- }
+ if((fd = dial(addr, 0, 0, &ctl)) < 0)
+ return nil;
+
+ if(proxy){
+ if(strcmp(proxy->scheme, "https") == 0)
+ fd = tlswrap(fd, proxy->host);
+ } else {
+ if(strcmp(u->scheme, "https") == 0)
+ fd = tlswrap(fd, u->host);
}
if(fd < 0){
close(ctl);