summaryrefslogtreecommitdiff
path: root/appl/cmd/webgrab.b
diff options
context:
space:
mode:
Diffstat (limited to 'appl/cmd/webgrab.b')
-rw-r--r--appl/cmd/webgrab.b11
1 files changed, 8 insertions, 3 deletions
diff --git a/appl/cmd/webgrab.b b/appl/cmd/webgrab.b
index 4e8fd6ce..062c342b 100644
--- a/appl/cmd/webgrab.b
+++ b/appl/cmd/webgrab.b
@@ -31,6 +31,9 @@ include "daytime.m";
include "bufio.m";
B: Bufio;
+include "dial.m";
+ D: Dial;
+
include "arg.m";
Webgrab: module
@@ -52,6 +55,7 @@ init(nil: ref Draw->Context, args: list of string)
S = load String String->PATH;
U = load Url Url->PATH;
DT = load Daytime Daytime->PATH;
+ D = load Dial Dial->PATH;
B = load Bufio Bufio->PATH;
arg := load Arg Arg->PATH;
if(S == nil || U == nil || DT == nil || B == nil || arg == nil)
@@ -381,9 +385,10 @@ httpget(u: ref ParsedUrl) : (string, array of byte, ref Sys->FD, ref ParsedUrl)
dialhost = u.host;
port = u.port;
}
- (ok, net) := sys->dial("tcp!" + dialhost + "!" + port, nil);
- if(ok < 0)
- return (sys->sprint("can't dial %s: %r", dialhost), nil, nil, nil);
+ dest := D->netmkaddr(dialhost, "tcp", port);
+ net := D->dial(dest, nil);
+ if(net == nil)
+ return (sys->sprint("can't dial %s: %r", dest), nil, nil, nil);
# prepare request
if(u.query != ""){