From a55a038d9977c89903ab8c6373a03d0810fe6435 Mon Sep 17 00:00:00 2001 From: Erik Troan Date: Sat, 24 Nov 2001 15:51:34 +0000 Subject: compilable again --- loader/urltest.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'loader/urltest.c') diff --git a/loader/urltest.c b/loader/urltest.c index e9e22b5c7..7df2bf555 100644 --- a/loader/urltest.c +++ b/loader/urltest.c @@ -2,33 +2,43 @@ #include "urls.h" +int haveKon = 0; +int continuing = 0; + +void stopNewt(void) { +} + int main(void) { struct iurlinfo iu; char doSecondary; - char buf[1024]; int fd; int size; + int total = 0; + char buf[16384]; + newtInit(); newtCls(); memset(&iu, 0, sizeof(iu)); - iu.protocol = URL_METHOD_FTP; - iu.address = "mercury.devel.redhat.com"; - iu.prefix = "/mnt/redhat/test/oot/i386"; - iu.protocol = URL_METHOD_HTTP; - iu.address = "mercury.devel.redhat.com"; + iu.address = "localhost"; iu.prefix = "/"; - fd = urlinstStartTransfer(&iu, "test.html"); + iu.protocol = URL_METHOD_FTP; + iu.address = "localhost"; + iu.prefix = "/pub/oot/i386"; + + fd = urlinstStartTransfer(&iu, "RedHat/base/netstg1.img", 1); if (fd >= 0) { - size = read(fd, buf, sizeof(buf)); - buf[size] = '\0'; + while ((size = read(fd, buf, sizeof(buf))) > 0) + total += size; urlinstFinishTransfer(&iu, fd); - newtWinMessage("Got it", "OK", "Got: '%s'", buf); + newtWinMessage("Got it", "OK", "Got: %d bytes\n", total); + } else { + newtWinMessage("Failed", "OK", ":-("); } newtFinished(); -- cgit