MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / InetGetFile

Method InetGetFile

netcon/inetfile/inetgetfile.cpp:133–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133InetGetFile::InetGetFile(char *URL, char *localfile, char *proxyip, int16_t proxyport) {
134 m_HardError = 0;
135 http = NULL;
136 ftp = NULL;
137 if ((URL == NULL) || (localfile == NULL)) {
138 m_HardError = INET_ERROR_BADPARMS;
139 }
140 if (strstr(URL, "http:")) {
141 m_bUseHTTP = true;
142 http = new ChttpGet(URL, localfile, proxyip, proxyport);
143 if (http == NULL)
144 m_HardError = INET_ERROR_NO_MEMORY;
145 } else if (strstr(URL, "HTTP:")) {
146 m_bUseHTTP = true;
147 http = new ChttpGet(URL, localfile, proxyip, proxyport);
148 if (http == NULL)
149 m_HardError = INET_ERROR_NO_MEMORY;
150 } else if (strstr(URL, "FTP:")) {
151 m_bUseHTTP = false;
152 ftp = new CFtpGet(URL, localfile);
153 if (ftp == NULL)
154 m_HardError = INET_ERROR_NO_MEMORY;
155 } else if (strstr(URL, "ftp:")) {
156 m_bUseHTTP = false;
157 ftp = new CFtpGet(URL, localfile);
158 if (ftp == NULL)
159 m_HardError = INET_ERROR_NO_MEMORY;
160 } else {
161 m_HardError = INET_ERROR_CANT_PARSE_URL;
162 }
163 Sleep(1000);
164}
165
166InetGetFile::InetGetFile(char *URL, char *localfile) {
167 m_HardError = 0;

Callers

nothing calls this directly

Calls 1

SleepFunction · 0.70

Tested by

no test coverage detected