mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
webfs: fix "fd out of range" error message
This commit is contained in:
parent
4e665c8662
commit
66892eb133
1 changed files with 9 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue