summaryrefslogtreecommitdiff
path: root/appl/lib/tftp.b
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2015-04-29 17:44:33 +0100
committerCharles Forsyth <charles.forsyth@gmail.com>2015-04-29 17:44:33 +0100
commitfbc1184c08d18d5ac0f8763a058e015e95353341 (patch)
treef045cdfaaf13c35295d34cb0c2ffd7f4cf2ef30d /appl/lib/tftp.b
parent83eae27259078c96c074211a51bf38c774490544 (diff)
switch to Dial module
Diffstat (limited to 'appl/lib/tftp.b')
-rw-r--r--appl/lib/tftp.b8
1 files changed, 6 insertions, 2 deletions
diff --git a/appl/lib/tftp.b b/appl/lib/tftp.b
index f112b892..29d6e7cd 100644
--- a/appl/lib/tftp.b
+++ b/appl/lib/tftp.b
@@ -3,6 +3,9 @@ implement Tftp;
include "sys.m";
sys: Sys;
+include "dial.m";
+ dial: Dial;
+
include "tftp.m";
Maxretry: con 5; # retries per block
@@ -62,6 +65,7 @@ timeoutstart(howlong: int): chan of int
init(p: int)
{
sys = load Sys Sys->PATH;
+ dial = load Dial Dial->PATH;
progress = p;
}
@@ -80,8 +84,8 @@ receive(host: string, filename: string, fd: ref Sys->FD): string
{
rbuf: array of byte;
- (ok, conn) := sys->dial("udp!" + host + "!69", nil);
- if(ok < 0)
+ conn := dial->dial(dial->netmkaddr(host, "udp", "69"), nil);
+ if(conn == nil)
return sys->sprint("can't dial %s: %r", host);
buf := array[Tftphdrlen + Maxblock] of byte;
i := 0;