MCPcopy Create free account
hub / github.com/assaultcube/AC / reset

Method reset

source/src/http.cpp:13–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11const char lfcrlf[] = { LF, CR, LF, 0x00 }, *crlf = lfcrlf + 1;
12
13void httpget::reset(int keep) // keep == 0: delete all, keep == 1: keep connection, keep == 2: keep connection and url
14{
15 if(keep < 1)
16 { // reset connection
17 DELSTRING(hostname);
18 ip.host = ENET_HOST_ANY;
19 ip.port = 80; // change manually, if needed
20 maxredirects = 3;
21 maxtransfer = maxsize = 2<<20; // 2 MB (caps transfer size and unzipped size)
22 connecttimeout = 6000;
23 disconnect();
24 }
25 err = NULL;
26 response = chunked = gzipped = contentlength = offset = elapsedtime = traffic = 0;
27 if(keep < 2) DELSTRING(url);
28 DELSTRING(header);
29 rawsnd.setsize(0);
30 rawrec.setsize(0);
31 datarec.setsize(0);
32}
33
34bool httpget::set_host(const char *newhostname) // set and resolve host
35{

Callers 5

recomputecameraFunction · 0.45
server.cppFile · 0.45
localconnectFunction · 0.45
soundcleanupMethod · 0.45
stopsoundMethod · 0.45

Calls 2

disconnectFunction · 0.85
setsizeMethod · 0.80

Tested by

no test coverage detected