From fbc1184c08d18d5ac0f8763a058e015e95353341 Mon Sep 17 00:00:00 2001 From: Charles Forsyth Date: Wed, 29 Apr 2015 17:44:33 +0100 Subject: switch to Dial module --- appl/lib/tftp.b | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'appl/lib/tftp.b') 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; -- cgit v1.2.3