diff options
author | Erik Troan <ewt@redhat.com> | 2001-11-24 15:51:34 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-11-24 15:51:34 +0000 |
commit | a55a038d9977c89903ab8c6373a03d0810fe6435 (patch) | |
tree | d12dd461456c09103511be672d1eb69724af6588 /loader/urltest.c | |
parent | 7cb06c2887cad4b69f1378f45c59cc66aaf81555 (diff) | |
download | anaconda-a55a038d9977c89903ab8c6373a03d0810fe6435.tar.gz anaconda-a55a038d9977c89903ab8c6373a03d0810fe6435.tar.xz anaconda-a55a038d9977c89903ab8c6373a03d0810fe6435.zip |
compilable again
Diffstat (limited to 'loader/urltest.c')
-rw-r--r-- | loader/urltest.c | 30 |
1 files changed, 20 insertions, 10 deletions
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(); |