| 11 | const char lfcrlf[] = { LF, CR, LF, 0x00 }, *crlf = lfcrlf + 1; |
| 12 | |
| 13 | void 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 | |
| 34 | bool httpget::set_host(const char *newhostname) // set and resolve host |
| 35 | { |
no test coverage detected