summaryrefslogtreecommitdiffstats
path: root/loader/urltest.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-11-24 15:51:34 +0000
committerErik Troan <ewt@redhat.com>2001-11-24 15:51:34 +0000
commita55a038d9977c89903ab8c6373a03d0810fe6435 (patch)
treed12dd461456c09103511be672d1eb69724af6588 /loader/urltest.c
parent7cb06c2887cad4b69f1378f45c59cc66aaf81555 (diff)
downloadanaconda-a55a038d9977c89903ab8c6373a03d0810fe6435.tar.gz
anaconda-a55a038d9977c89903ab8c6373a03d0810fe6435.tar.xz
anaconda-a55a038d9977c89903ab8c6373a03d0810fe6435.zip
compilable again
Diffstat (limited to 'loader/urltest.c')
-rw-r--r--loader/urltest.c30
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();