X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fwget_src%2Fmain.c;h=9b5391f13c9e00c53103065934fc419db402ca77;hb=bdefac5f54668fcccff11a69619ff31b25595eeb;hp=508437457a46b85b5744297dff3f6f842cbe161e;hpb=6d5af90c1f5fbba2e51752b1312936aa1b481d80;p=tpg%2Facess2.git diff --git a/Usermode/Applications/wget_src/main.c b/Usermode/Applications/wget_src/main.c index 50843745..9b5391f1 100644 --- a/Usermode/Applications/wget_src/main.c +++ b/Usermode/Applications/wget_src/main.c @@ -11,6 +11,7 @@ #include #include #include +#include // _SysDebug enum eProcols { @@ -84,7 +85,13 @@ int main(int argc, char *argv[]) continue ; } - rv = getaddrinfo(uri->Host, NULL, NULL, &addrinfo); + if( proto != PROTO_HTTP ) { + fprintf(stderr, "TODO: Support protocols other than HTTP\n"); + free(uri); + continue ; + } + + rv = getaddrinfo(uri->Host, "http", NULL, &addrinfo); if( rv != 0 ) { fprintf(stderr, "Unable to resolve %s: %s\n", uri->Host, gai_strerror(rv)); continue ; @@ -158,7 +165,7 @@ int main(int argc, char *argv[]) if( state == 2 ) { _SysDebug("RXing %i bytes to '%s'", bytes_wanted, outfile); - int outfd = open(outfile, O_WR|O_CREAT, 0666); + int outfd = open(outfile, O_WRONLY|O_CREAT, 0666); if( outfd == -1 ) { fprintf(stderr, "Unable to open '%s' for writing\n", outfile); }