MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlNanoFTPScanProxy

Function xmlNanoFTPScanProxy

ThirdParty/libxml2/vtklibxml2/nanoftp.c:392–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390 */
391
392void
393xmlNanoFTPScanProxy(const char *URL) {
394 xmlURIPtr uri;
395
396 if (proxy != NULL) {
397 xmlFree(proxy);
398 proxy = NULL;
399 }
400 proxyPort = 0;
401
402 if (URL == NULL) return;
403
404 uri = xmlParseURIRaw(URL, 1);
405 if ((uri == NULL) || (uri->scheme == NULL) ||
406 (strcmp(uri->scheme, "ftp")) || (uri->server == NULL)) {
407 __xmlIOErr(XML_FROM_FTP, XML_FTP_URL_SYNTAX, "Syntax Error\n");
408 if (uri != NULL)
409 xmlFreeURI(uri);
410 return;
411 }
412
413 proxy = xmlMemStrdup(uri->server);
414 if (uri->port != 0)
415 proxyPort = uri->port;
416
417 xmlFreeURI(uri);
418}
419
420/**
421 * xmlNanoFTPNewCtxt:

Callers 1

xmlNanoFTPInitFunction · 0.70

Calls 3

xmlParseURIRawFunction · 0.85
__xmlIOErrFunction · 0.85
xmlFreeURIFunction · 0.85

Tested by

no test coverage detected