mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
remove test_downloader
This commit is contained in:
parent
5dcf02624d
commit
1a1e0d7486
@ -79,13 +79,3 @@
|
|||||||
pdecompress.cxx
|
pdecompress.cxx
|
||||||
|
|
||||||
#end bin_target
|
#end bin_target
|
||||||
|
|
||||||
#begin bin_target
|
|
||||||
#define TARGET test_downloader
|
|
||||||
#define BUILD_TARGET $[HAVE_ZLIB]
|
|
||||||
#define USE_PACKAGES $[USE_PACKAGES] zlib
|
|
||||||
|
|
||||||
#define SOURCES \
|
|
||||||
test_downloader.cxx
|
|
||||||
|
|
||||||
#end bin_target
|
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
// Filename: test_downloader.cxx
|
|
||||||
// Created by:
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// PANDA 3D SOFTWARE
|
|
||||||
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
|
||||||
//
|
|
||||||
// All use of this software is subject to the terms of the Panda 3d
|
|
||||||
// Software license. You should have received a copy of this license
|
|
||||||
// along with this source code; you will also find a current copy of
|
|
||||||
// the license at http://www.panda3d.org/license.txt .
|
|
||||||
//
|
|
||||||
// To contact the maintainers of this program write to
|
|
||||||
// panda3d@yahoogroups.com .
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#include <pandabase.h>
|
|
||||||
#include <downloader.h>
|
|
||||||
#include <error_utils.h>
|
|
||||||
#include <decompressor.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc, char *argv[]) {
|
|
||||||
|
|
||||||
//if (argc < 4) {
|
|
||||||
if (argc < 3) {
|
|
||||||
//cerr << "Usage: test_downloader <server> <source file> <dest file>"
|
|
||||||
cerr << "Usage: test_downloader <server> <source file>"
|
|
||||||
<< endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
string server_name = argv[1];
|
|
||||||
Filename src_file = argv[2];
|
|
||||||
//Filename dest_file = argv[3];
|
|
||||||
|
|
||||||
Downloader dl;
|
|
||||||
if (dl.connect_to_server(server_name) == false)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
//int ret = dl.initiate(src_file, dest_file);
|
|
||||||
int ret = dl.initiate(src_file);
|
|
||||||
if (ret < 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
//for (;;) {
|
|
||||||
bool done = false;
|
|
||||||
while (!done) {
|
|
||||||
ret = dl.run();
|
|
||||||
if (ret == EU_success) {
|
|
||||||
cerr << "bytes per second: " << dl.get_bytes_per_second() << endl;
|
|
||||||
//return 1;
|
|
||||||
done = true;
|
|
||||||
} else if (ret == EU_write) {
|
|
||||||
cerr << "bytes per second: " << dl.get_bytes_per_second() << endl;
|
|
||||||
} else if (ret < 0) {
|
|
||||||
cerr << "error!" << endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cerr << "download to memory complete" << endl;
|
|
||||||
Ramfile rfile;
|
|
||||||
dl.get_ramfile(rfile);
|
|
||||||
cerr << "ram file length: " << rfile._data.length() << endl;
|
|
||||||
Decompressor dc;
|
|
||||||
dc.decompress(rfile);
|
|
||||||
cerr << "ram file length: " << rfile._data.length() << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user