| 999 | } |
| 1000 | |
| 1001 | bool HttpSocket::Download |
| 1002 | ( |
| 1003 | const std::string& url, |
| 1004 | const char *extraRequest, |
| 1005 | void *user, |
| 1006 | const POST *post |
| 1007 | ) |
| 1008 | { |
| 1009 | if (_filename.length() == 0) { |
| 1010 | traceprint("No Filename Set\n"); |
| 1011 | return false; |
| 1012 | } |
| 1013 | Request req; |
| 1014 | req.user = user; |
| 1015 | if(post) |
| 1016 | req.post = *post; |
| 1017 | SplitURI(url, req.protocol, req.host, req.resource, req.port, req.useSSL); |
| 1018 | if(IsRedirecting() && req.host.empty()) // if we're following a redirection to the same host, the server is likely to omit its hostname |
| 1019 | req.host = _curRequest.host; |
| 1020 | if(req.port < 0) |
| 1021 | req.port = req.useSSL ? 443 : 80; |
| 1022 | if(extraRequest) |
| 1023 | req.extraGetHeaders = extraRequest; |
| 1024 | return SendRequest(req, false); |
| 1025 | } |
| 1026 | |
| 1027 | |
| 1028 | bool HttpSocket::_Redirect |
no test coverage detected