diff options
Diffstat (limited to 'appl/lib/tftp.b')
| -rw-r--r-- | appl/lib/tftp.b | 8 |
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; |
