16 #include "config_downloader.h"
17 #include "httpChannel.h"
18 #include "virtualFileHTTP.h"
19 #include "virtualFileMountHTTP.h"
20 #include "pandaSystem.h"
23 ConfigureDef(config_downloader);
24 NotifyCategoryDef(downloader,
"");
27 (
"downloader-byte-rate", 500000,
28 PRC_DESC(
"Specifies the default max bytes per second of throughput that is "
29 "supported by any HTTP connections with download-throttle enabled. "
30 "This may also be set on a per-channel basis with "
31 "HTTPChannel::set_max_bytes_per_second(). It has no effect unless "
32 "download-throttle (or HTTPChannel::set_download_throttle) is true."));
35 (
"download-throttle",
false,
36 PRC_DESC(
"When this is true, all HTTP channels will be bandwidth-limited "
37 "so as not to consume more than downloader-byte-rate bytes per "
41 (
"downloader-frequency", 0.2,
42 PRC_DESC(
"Frequency of download chunk requests in seconds (or fractions of) "
43 "(Estimated 200 msec round-trip to server)."));
46 (
"downloader-timeout", 15);
49 (
"downloader-timeout-retries", 5);
52 (
"decompressor-step-time", 0.005,
53 PRC_DESC(
"Specifies the maximum amount of time that should be consumed by "
54 "a single call to Decompressor::run()."));
57 (
"extractor-step-time", 0.005,
58 PRC_DESC(
"Specifies the maximum amount of time that should be consumed by "
59 "a single call to Extractor::step()."));
62 (
"patcher-buffer-size", 16384,
63 PRC_DESC(
"Limits the size of the buffer used in a single call to "
64 "Patcher::run(). Increasing this may help the Patcher "
65 "perform more work before returning."));
68 (
"http-proxy-tunnel",
false,
69 PRC_DESC(
"This specifies the default value for HTTPChannel::set_proxy_tunnel(). "
70 "If this is true, we will tunnel through a proxy for all connections, "
71 "instead of asking the proxy to serve documents normally."));
74 (
"http-connect-timeout", 10.0,
75 PRC_DESC(
"This is the default amount of time to wait for a TCP/IP connection "
76 "to be established, in seconds."));
79 (
"http-timeout", 20.0,
80 PRC_DESC(
"This is the default amount of time to wait for the HTTP server (or "
81 "proxy) to finish sending its response to our request, in seconds. "
82 "It starts counting after the TCP connection has been established "
83 "(http_connect_timeout, above) and the request has been sent."));
86 (
"http-skip-body-size", 8192,
87 PRC_DESC(
"This is the maximum number of bytes in a received "
88 "(but unwanted) body that will be skipped past, in "
89 "order to reset to a new request. "
90 "See HTTPChannel::set_skip_body_size()."));
93 (
"http-idle-timeout", 5.0,
94 PRC_DESC(
"This the amount of time, in seconds, in which a "
95 "previously-established connection is allowed to remain open "
96 "and unused. If a previous connection has remained unused for "
97 "at least this number of seconds, it will be closed and a new "
98 "connection will be opened; otherwise, the same connection "
99 "will be reused for the next request (for a particular "
103 (
"http-max-connect-count", 10,
104 PRC_DESC(
"This is the maximum number of times to try reconnecting to the "
105 "server on any one document attempt. This is just a failsafe to "
106 "prevent the code from attempting runaway connections; this limit "
107 "should never be reached in practice."));
110 (
"tcp-header-size", 2,
111 PRC_DESC(
"Specifies the number of bytes to use to specify the datagram "
112 "length when writing a datagram on a TCP stream. This may be "
113 "0, 2, or 4. The server and client must agree on this value."));
115 ConfigureFn(config_downloader) {
116 init_libdownloader();
128 init_libdownloader() {
129 static bool initialized =
false;
136 HTTPChannel::init_type();
137 VirtualFileHTTP::init_type();
138 VirtualFileMountHTTP::init_type();
140 VirtualFileMountHTTP::reload_vfs_mount_url();
145 (
"early-random-seed",
false,
146 PRC_DESC(
"Configure this true to compute the SSL random seed "
147 "early on in the application (specifically, when the libpandaexpress "
148 "library is loaded), or false to defer this until it is actually "
149 "needed (which will be the first time you open an https connection "
150 "or otherwise use encryption services). You can also call "
151 "HTTPClient::init_random_seed() to "
152 "do this when you are ready. The issue is that on Windows, "
153 "OpenSSL will attempt to "
154 "randomize its seed by crawling through the entire heap of "
155 "allocated memory, which can be extremely large in a Panda "
156 "application, especially if you have already opened a window and "
157 "started rendering; and so this can take as much as 30 seconds "
158 "or more. For this reason it is best to initialize the random "
159 "seed at startup, when the application is still very small."));
160 if (early_random_seed) {
161 HTTPClient::init_random_seed();
166 #endif // HAVE_OPENSSL
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
This class is used as a namespace to group several global properties of Panda.
This is a convenience class to specialize ConfigVariable as a boolean type.
void add_system(const string &system)
Intended for use by each subsystem to register itself at startup.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This is a convenience class to specialize ConfigVariable as an integer type.