summaryrefslogtreecommitdiffstats
path: root/loader/urltest.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-05-26 16:19:37 +0000
committerErik Troan <ewt@redhat.com>2000-05-26 16:19:37 +0000
commit227fceda9a06651887fa5e8bc0f12f3117e85bb2 (patch)
tree1f3fb8c49ff5d4207584ac2b652728ed7374a2f0 /loader/urltest.c
parentc4ee6ff38166e8c71f8b717b55a1384a7a7ddbb3 (diff)
downloadanaconda-227fceda9a06651887fa5e8bc0f12f3117e85bb2.tar.gz
anaconda-227fceda9a06651887fa5e8bc0f12f3117e85bb2.tar.xz
anaconda-227fceda9a06651887fa5e8bc0f12f3117e85bb2.zip
*** empty log message ***
Diffstat (limited to 'loader/urltest.c')
-rw-r--r--loader/urltest.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/loader/urltest.c b/loader/urltest.c
new file mode 100644
index 000000000..817e4aff3
--- /dev/null
+++ b/loader/urltest.c
@@ -0,0 +1,35 @@
+#include <newt.h>
+
+#include "urls.h"
+
+int main(void) {
+ struct iurlinfo iu;
+ char doSecondary;
+ char buf[1024];
+ int fd;
+ int size;
+
+ 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.prefix = "/";
+
+ fd = urlinstStartTransfer(&iu, "test.html");
+ if (fd >= 0) {
+ size = read(fd, buf, sizeof(buf));
+ buf[size] = '\0';
+ urlinstFinishTransfer(&iu, fd);
+
+ newtWinMessage("Got it", "Ok", "Got: '%s'", buf);
+ }
+
+ newtFinished();
+}