MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLHTTPEmitFetchDebug

Function CPLHTTPEmitFetchDebug

port/cpl_http.cpp:744–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742/************************************************************************/
743
744static void CPLHTTPEmitFetchDebug(const char *pszURL,
745 const char *pszExtraDebug = "")
746{
747 const char *pszArobase = strchr(pszURL, '@');
748 const char *pszSlash = strchr(pszURL, '/');
749 const char *pszColon = (pszSlash) ? strchr(pszSlash, ':') : nullptr;
750 if (pszArobase != nullptr && pszColon != nullptr &&
751 pszArobase - pszColon > 0)
752 {
753 /* http://user:password@www.example.com */
754 char *pszSanitizedURL = CPLStrdup(pszURL);
755 pszSanitizedURL[pszColon - pszURL] = 0;
756 CPLDebug("HTTP", "Fetch(%s:#password#%s%s)", pszSanitizedURL,
757 pszArobase, pszExtraDebug);
758 CPLFree(pszSanitizedURL);
759 }
760 else
761 {
762 CPLDebug("HTTP", "Fetch(%s%s)", pszURL, pszExtraDebug);
763 }
764}
765
766#endif
767

Callers 2

CPLHTTPFetchExFunction · 0.85
CPLHTTPMultiFetchFunction · 0.85

Calls 2

CPLStrdupFunction · 0.85
CPLDebugFunction · 0.85

Tested by

no test coverage detected