13#ifndef CPL_VSIL_CURL_CLASS_H_INCLUDED
14#define CPL_VSIL_CURL_CLASS_H_INCLUDED
23#include "cpl_vsil_curl_priv.h"
24#include "cpl_mem_cache.h"
26#include "cpl_curl_priv.h"
30#include <condition_variable>
46#define HAVE_CURLINFO_REDIRECT_URL
48void VSICurlStreamingClearCache(
void);
50struct curl_slist *VSICurlSetOptions(CURL *hCurlHandle,
const char *pszURL,
51 const char *
const *papszOptions);
52struct curl_slist *VSICurlMergeHeaders(
struct curl_slist *poDest,
53 struct curl_slist *poSrcToDestroy);
55struct curl_slist *VSICurlSetContentTypeFromExt(
struct curl_slist *polist,
58struct curl_slist *VSICurlSetCreationHeadersFromOptions(
59 struct curl_slist *headers,
CSLConstList papszOptions,
const char *pszPath);
74 unsigned int nGenerationAuthParameters = 0;
75 ExistStatus eExists = EXIST_UNKNOWN;
79 time_t nExpireTimestampLocal = 0;
80 std::string osRedirectURL{};
81 bool bHasComputedFileSize =
false;
82 bool bIsDirectory =
false;
83 bool bIsAzureFolder =
false;
85 bool bS3LikeRedirect =
false;
91 bool bGotFileList =
false;
92 unsigned int nGenerationAuthParameters = 0;
98 char *pBuffer =
nullptr;
100 bool bIsHTTP =
false;
101 bool bMultiRange =
false;
105 int nFirstHTTPCode = 0;
107 bool bFoundContentRange =
false;
109 bool bInterruptDownload =
false;
110 bool bDetectRangeDownloadingError =
false;
114 VSICurlReadCbkFunc pfnReadCbk =
nullptr;
115 void *pReadCbkUserData =
nullptr;
116 bool bInterrupted =
false;
121 const GByte *pabyData =
nullptr;
123 size_t nTotalSize = 0;
125 static size_t ReadCallBackBuffer(
char *buffer,
size_t size,
size_t nitems,
128 PutData *poThis =
static_cast<PutData *
>(instream);
129 const size_t nSizeMax = size * nitems;
130 const size_t nSizeToWrite =
131 std::min(nSizeMax, poThis->nTotalSize - poThis->nOff);
132 memcpy(buffer, poThis->pabyData + poThis->nOff, nSizeToWrite);
133 poThis->nOff += nSizeToWrite;
144class VSICurlFilesystemHandlerBase :
public VSIFilesystemHandler
148 struct FilenameOffsetPair
150 std::string filename_;
153 FilenameOffsetPair(
const std::string &filename,
vsi_l_offset offset)
154 : filename_(filename), offset_(offset)
158 bool operator==(
const FilenameOffsetPair &other)
const
160 return filename_ == other.filename_ && offset_ == other.offset_;
164 struct FilenameOffsetPairHasher
166 std::size_t operator()(
const FilenameOffsetPair &k)
const
168 return std::hash<std::string>()(k.filename_) ^
169 std::hash<vsi_l_offset>()(k.offset_);
173 using RegionCacheType = lru11::Cache<
174 FilenameOffsetPair, std::shared_ptr<std::string>, lru11::NullLock,
177 typename std::list<lru11::KeyValuePair<
178 FilenameOffsetPair, std::shared_ptr<std::string>>>::iterator,
179 FilenameOffsetPairHasher>>;
181 std::unique_ptr<RegionCacheType>
182 m_poRegionCacheDoNotUseDirectly{};
184 RegionCacheType *GetRegionCache();
191 lru11::Cache<std::string, bool> oCacheFileProp;
193 int nCachedFilesInDirList = 0;
194 lru11::Cache<std::string, CachedDirList> oCacheDirList;
196 char **ParseHTMLFileList(
const char *pszFilename,
int nMaxFiles,
197 char *pszData,
bool *pbGotFileList);
202 struct RegionInDownload
205 std::condition_variable oCond{};
206 bool bDownloadInProgress =
false;
208 std::string osData{};
211 std::mutex m_oMutex{};
212 std::map<std::string, std::unique_ptr<RegionInDownload>>
213 m_oMapRegionInDownload{};
216 CPLMutex *hMutex =
nullptr;
218 virtual VSICurlHandle *CreateFileHandle(
const char *pszFilename);
219 virtual char **GetFileList(
const char *pszFilename,
int nMaxFiles,
220 bool *pbGotFileList);
222 void RegisterEmptyDir(
const std::string &osDirname);
225 AnalyseS3FileList(
const std::string &osBaseURL,
const char *pszXML,
227 const std::set<std::string> &oSetIgnoredStorageClasses,
230 void AnalyseSwiftFileList(
const std::string &osBaseURL,
231 const std::string &osPrefix,
const char *pszJson,
233 int nMaxFiles,
bool &bIsTruncated,
234 std::string &osNextMarker);
236 static const char *GetOptionsStatic();
238 VSICurlFilesystemHandlerBase();
241 ~VSICurlFilesystemHandlerBase()
override;
243 static bool IsAllowedFilename(
const char *pszFilename);
249 int Stat(
const char *pszFilename,
VSIStatBufL *pStatBuf,
250 int nFlags)
override;
251 int Unlink(
const char *pszFilename)
override;
252 int Rename(
const char *oldpath,
const char *newpath)
override;
253 int Mkdir(
const char *pszDirname,
long nMode)
override;
254 int Rmdir(
const char *pszDirname)
override;
255 char **ReadDirEx(
const char *pszDirname,
int nMaxFiles)
override;
256 char **SiblingFiles(
const char *pszFilename)
override;
258 int HasOptimizedReadMultiRange(
const char * )
override
263 const char *GetActualURL(
const char *pszFilename)
override;
265 const char *GetOptions()
override;
267 char **GetFileMetadata(
const char *pszFilename,
const char *pszDomain,
270 char **ReadDirInternal(
const char *pszDirname,
int nMaxFiles,
271 bool *pbGotFileList);
272 void InvalidateDirContent(
const char *pszDirname);
274 virtual const char *GetDebugKey()
const = 0;
276 virtual std::string GetFSPrefix()
const = 0;
277 virtual bool AllowCachedDataFor(
const char *pszFilename);
279 virtual bool IsLocal(
const char * )
override
285 SupportsSequentialWrite(
const char * ,
291 virtual bool SupportsRandomWrite(
const char * ,
297 std::shared_ptr<std::string> GetRegion(
const char *pszURL,
300 void AddRegion(
const char *pszURL,
vsi_l_offset nFileOffsetStart,
301 size_t nSize,
const char *pData);
303 std::pair<bool, std::string>
304 NotifyStartDownloadRegion(
const std::string &osURL,
306 void NotifyStopDownloadRegion(
const std::string &osURL,
308 const std::string &osData);
310 bool GetCachedFileProp(
const char *pszURL, FileProp &oFileProp);
311 void SetCachedFileProp(
const char *pszURL, FileProp &oFileProp);
312 void InvalidateCachedData(
const char *pszURL);
314 CURLM *GetCurlMultiHandleFor(
const std::string &osURL);
316 virtual void ClearCache();
317 virtual void PartialClearCache(
const char *pszFilename);
319 bool GetCachedDirList(
const char *pszURL, CachedDirList &oCachedDirList);
320 void SetCachedDirList(
const char *pszURL, CachedDirList &oCachedDirList);
321 bool ExistsInCacheDirList(
const std::string &osDirname,
bool *pbIsDir);
323 virtual std::string GetURLFromFilename(
const std::string &osFilename)
const;
326 GetStreamingFilename(
const std::string &osFilename)
const override = 0;
328 static std::set<std::string> GetS3IgnoredStorageClasses();
331class VSICurlFilesystemHandler :
public VSICurlFilesystemHandlerBase
336 VSICurlFilesystemHandler() =
default;
338 const char *GetDebugKey()
const override
343 std::string GetFSPrefix()
const override
349 GetStreamingFilename(
const std::string &osFilename)
const override;
361 VSICurlFilesystemHandlerBase *poFS =
nullptr;
363 bool m_bCached =
true;
365 mutable FileProp oFileProp{};
367 mutable std::mutex m_oMutex{};
368 std::string m_osFilename{};
369 char *m_pszURL =
nullptr;
370 mutable std::string m_osQueryString{};
373 CPLHTTPRetryParameters
377 int nBlocksToDownload = 1;
379 bool bStopOnInterruptUntilUninstall =
false;
380 bool bInterrupted =
false;
381 VSICurlReadCbkFunc pfnReadCbk =
nullptr;
382 void *pReadCbkUserData =
nullptr;
386 void DownloadRegionPostProcess(
const vsi_l_offset startOffset,
387 const int nBlocks,
const char *pBuffer,
396 virtual std::string DownloadRegion(
vsi_l_offset startOffset,
int nBlocks);
398 bool m_bUseHead =
false;
399 bool m_bUseRedirectURLIfNoQueryStringParams =
false;
401 mutable std::atomic<bool> m_bInterrupt =
false;
405 mutable bool m_bPlanetaryComputerURLSigning =
false;
406 mutable std::string m_osPlanetaryComputerCollection{};
407 void ManagePlanetaryComputerSigning()
const;
409 int ReadMultiRangeSingleGet(
int nRanges,
void **ppData,
411 const size_t *panSizes);
412 std::string GetRedirectURLIfValid(
bool &bHasExpired,
415 void UpdateRedirectInfo(CURL *hCurlHandle,
416 const WriteFuncStruct &sWriteFuncHeaderData);
419 struct AdviseReadRange
423 std::condition_variable oCV{};
426 std::vector<GByte> abyData{};
429 std::vector<std::unique_ptr<AdviseReadRange>> m_aoAdviseReadRanges{};
430 std::thread m_oThreadAdviseRead{};
433 virtual struct curl_slist *
434 GetCurlHeaders(
const std::string & ,
435 const struct curl_slist * )
440 virtual bool AllowAutomaticRedirection()
445 virtual bool CanRestartOnError(
const char *,
const char *,
bool)
450 virtual bool UseLimitRangeGetInsteadOfHead()
455 virtual bool IsDirectoryFromExists(
const char * ,
461 virtual void ProcessGetFileSizeResult(
const char * )
465 void SetURL(
const char *pszURL);
467 virtual bool Authenticate(
const char * )
473 VSICurlHandle(VSICurlFilesystemHandlerBase *poFS,
const char *pszFilename,
474 const char *pszURLIn =
nullptr);
475 ~VSICurlHandle()
override;
479 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
480 int ReadMultiRange(
int nRanges,
void **ppData,
482 const size_t *panSizes)
override;
483 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
484 void ClearErr()
override;
486 int Error()
override;
487 int Flush()
override;
488 int Close()
override;
490 void Interrupt()
override
495 bool HasPRead()
const override
500 size_t PRead(
void *pBuffer,
size_t nSize,
503 void AdviseRead(
int nRanges,
const vsi_l_offset *panOffsets,
504 const size_t *panSizes)
override;
506 size_t GetAdviseReadTotalBytesLimit()
const override;
508 bool IsKnownFileSize()
const
510 return oFileProp.bHasComputedFileSize;
513 vsi_l_offset GetFileSizeOrHeaders(
bool bSetError,
bool bGetHeaders);
517 return GetFileSizeOrHeaders(bSetError,
false);
520 bool Exists(
bool bSetError);
522 bool IsDirectory()
const
524 return oFileProp.bIsDirectory;
529 return oFileProp.nMode;
532 time_t GetMTime()
const
534 return oFileProp.mTime;
542 int InstallReadCbk(VSICurlReadCbkFunc pfnReadCbk,
void *pfnUserData,
543 int bStopOnInterruptUntilUninstall);
544 int UninstallReadCbk();
546 const char *GetURL()
const
556class VSICurlFilesystemHandlerBaseWritable :
public VSICurlFilesystemHandlerBase
561 VSICurlFilesystemHandlerBaseWritable() =
default;
563 virtual VSIVirtualHandleUniquePtr
564 CreateWriteHandle(
const char *pszFilename,
CSLConstList papszOptions) = 0;
570 bool SupportsSequentialWrite(
const char * ,
576 bool SupportsRandomWrite(
const char * ,
584class IVSIS3LikeFSHandler :
public VSICurlFilesystemHandlerBaseWritable
588 virtual int MkdirInternal(
const char *pszDirname,
long nMode,
592 char **GetFileList(
const char *pszFilename,
int nMaxFiles,
593 bool *pbGotFileList)
override;
595 virtual IVSIS3LikeHandleHelper *CreateHandleHelper(
const char *pszURI,
596 bool bAllowNoObject) = 0;
598 virtual int CopyObject(
const char *oldpath,
const char *newpath,
601 int RmdirRecursiveInternal(
const char *pszDirname,
int nBatchSize);
604 IsAllowedHeaderForObjectCreation(
const char * )
609 IVSIS3LikeFSHandler() =
default;
612 int Unlink(
const char *pszFilename)
override;
613 int Mkdir(
const char *pszDirname,
long nMode)
override;
614 int Rmdir(
const char *pszDirname)
override;
615 int Stat(
const char *pszFilename,
VSIStatBufL *pStatBuf,
616 int nFlags)
override;
617 int Rename(
const char *oldpath,
const char *newpath)
override;
619 virtual int CopyFile(
const char *pszSource,
const char *pszTarget,
621 const char *
const *papszOptions,
622 GDALProgressFunc pProgressFunc,
623 void *pProgressData)
override;
625 virtual int DeleteObject(
const char *pszFilename);
627 virtual int *DeleteObjectBatch(
CSLConstList papszFilesOrDirs);
629 bool Sync(
const char *pszSource,
const char *pszTarget,
630 const char *
const *papszOptions, GDALProgressFunc pProgressFunc,
631 void *pProgressData,
char ***ppapszOutputs)
override;
633 VSIDIR *OpenDir(
const char *pszPath,
int nRecurseDepth,
634 const char *
const *papszOptions)
override;
641class IVSIS3LikeFSHandlerWithMultipartUpload :
public IVSIS3LikeFSHandler
646 IVSIS3LikeFSHandlerWithMultipartUpload() =
default;
649 virtual bool SupportsNonSequentialMultipartUpload()
const
654 virtual bool SupportsParallelMultipartUpload()
const
659 virtual bool SupportsMultipartAbort()
const = 0;
661 size_t GetUploadChunkSizeInBytes(
const char *pszFilename,
662 const char *pszSpecifiedValInBytes);
664 virtual int CopyFileRestartable(
const char *pszSource,
665 const char *pszTarget,
666 const char *pszInputPayload,
667 char **ppszOutputPayload,
669 GDALProgressFunc pProgressFunc,
670 void *pProgressData)
override;
676 virtual int GetMaximumPartCount()
685 virtual int GetMinimumPartSizeInMiB()
694 virtual int GetMaximumPartSizeInMiB()
706 virtual int GetDefaultPartSizeInMiB()
712 InitiateMultipartUpload(
const std::string &osFilename,
713 IVSIS3LikeHandleHelper *poS3HandleHelper,
714 const CPLHTTPRetryParameters &oRetryParameters,
718 UploadPart(
const std::string &osFilename,
int nPartNumber,
720 const void *pabyBuffer,
size_t nBufferSize,
721 IVSIS3LikeHandleHelper *poS3HandleHelper,
722 const CPLHTTPRetryParameters &oRetryParameters,
725 virtual bool CompleteMultipart(
726 const std::string &osFilename,
const std::string &osUploadID,
727 const std::vector<std::string> &aosEtags,
vsi_l_offset nTotalSize,
728 IVSIS3LikeHandleHelper *poS3HandleHelper,
729 const CPLHTTPRetryParameters &oRetryParameters);
731 virtual bool AbortMultipart(
const std::string &osFilename,
732 const std::string &osUploadID,
733 IVSIS3LikeHandleHelper *poS3HandleHelper,
734 const CPLHTTPRetryParameters &oRetryParameters);
736 bool AbortPendingUploads(
const char *pszFilename)
override;
738 bool MultipartUploadGetCapabilities(
int *pbNonSequentialUploadSupported,
739 int *pbParallelUploadSupported,
740 int *pbAbortSupported,
741 size_t *pnMinPartSize,
742 size_t *pnMaxPartSize,
743 int *pnMaxPartCount)
override;
745 char *MultipartUploadStart(
const char *pszFilename,
748 char *MultipartUploadAddPart(
const char *pszFilename,
749 const char *pszUploadId,
int nPartNumber,
754 bool MultipartUploadEnd(
const char *pszFilename,
const char *pszUploadId,
755 size_t nPartIdsCount,
756 const char *
const *apszPartIds,
760 bool MultipartUploadAbort(
const char *pszFilename,
const char *pszUploadId,
768class IVSIS3LikeHandle :
public VSICurlHandle
773 bool UseLimitRangeGetInsteadOfHead()
override
778 bool IsDirectoryFromExists(
const char *pszVerb,
int response_code)
override
781 return response_code == 416 &&
EQUAL(pszVerb,
"GET") &&
782 std::string(m_pszURL).back() ==
'/';
785 void ProcessGetFileSizeResult(
const char *pszContent)
override
787 oFileProp.bIsDirectory =
788 strstr(pszContent,
"ListBucketResult") !=
nullptr;
792 IVSIS3LikeHandle(VSICurlFilesystemHandlerBase *poFSIn,
793 const char *pszFilename,
const char *pszURLIn)
794 : VSICurlHandle(poFSIn, pszFilename, pszURLIn)
798 ~IVSIS3LikeHandle()
override
811 IVSIS3LikeFSHandlerWithMultipartUpload *m_poFS =
nullptr;
812 std::string m_osFilename{};
813 IVSIS3LikeHandleHelper *m_poS3HandleHelper =
nullptr;
816 CPLHTTPRetryParameters m_oRetryParameters;
819 size_t m_nBufferOff = 0;
820 size_t m_nBufferSize = 0;
821 bool m_bClosed =
false;
822 GByte *m_pabyBuffer =
nullptr;
823 std::string m_osUploadID{};
824 int m_nPartNumber = 0;
825 std::vector<std::string> m_aosEtags{};
826 bool m_bError =
false;
828 WriteFuncStruct m_sWriteFuncHeaderData{};
831 bool DoSinglePartPUT();
833 void InvalidateParentDirectory();
836 VSIMultipartWriteHandle(IVSIS3LikeFSHandlerWithMultipartUpload *poFS,
837 const char *pszFilename,
838 IVSIS3LikeHandleHelper *poS3HandleHelper,
840 ~VSIMultipartWriteHandle()
override;
844 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
845 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
847 void ClearErr()
override
861 int Close()
override;
865 return m_pabyBuffer !=
nullptr;
880 IVSIS3LikeFSHandler *m_poFS =
nullptr;
881 std::string m_osFilename{};
882 IVSIS3LikeHandleHelper *m_poS3HandleHelper =
nullptr;
885 CPLHTTPRetryParameters m_oRetryParameters;
888 size_t m_nBufferOff = 0;
889 bool m_bError =
false;
890 bool m_bClosed =
false;
892 CURLM *m_hCurlMulti =
nullptr;
893 CURL *m_hCurl =
nullptr;
894 const void *m_pBuffer =
nullptr;
895 std::string m_osCurlErrBuf{};
896 size_t m_nChunkedBufferOff = 0;
897 size_t m_nChunkedBufferSize = 0;
898 size_t m_nWrittenInPUT = 0;
900 WriteFuncStruct m_sWriteFuncHeaderData{};
902 static size_t ReadCallBackBufferChunked(
char *buffer,
size_t size,
903 size_t nitems,
void *instream);
904 int FinishChunkedTransfer();
908 void InvalidateParentDirectory();
911 VSIChunkedWriteHandle(IVSIS3LikeFSHandler *poFS,
const char *pszFilename,
912 IVSIS3LikeHandleHelper *poS3HandleHelper,
914 virtual ~VSIChunkedWriteHandle();
918 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
919 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
921 void ClearErr()
override
935 int Close()
override;
947 VSICurlFilesystemHandlerBase *m_poFS =
nullptr;
948 std::string m_osFSPrefix{};
949 std::string m_osFilename{};
950 CPLHTTPRetryParameters m_oRetryParameters{};
953 int m_nBufferOff = 0;
954 int m_nBufferSize = 0;
955 int m_nBufferOffReadCallback = 0;
956 bool m_bClosed =
false;
957 GByte *m_pabyBuffer =
nullptr;
958 bool m_bError =
false;
960 static size_t ReadCallBackBuffer(
char *buffer,
size_t size,
size_t nitems,
962 virtual bool Send(
bool bIsLastBlock) = 0;
965 VSIAppendWriteHandle(VSICurlFilesystemHandlerBase *poFS,
966 const char *pszFSPrefix,
const char *pszFilename,
968 virtual ~VSIAppendWriteHandle();
972 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
973 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
975 void ClearErr()
override
989 int Close()
override;
993 return m_pabyBuffer !=
nullptr;
1001struct VSIDIRWithMissingDirSynthesis :
public VSIDIR
1003 std::vector<std::unique_ptr<VSIDIREntry>> aoEntries{};
1006 std::vector<std::string> m_aosSubpathsStack{};
1008 void SynthetizeMissingDirectories(
const std::string &osCurSubdir,
1009 bool bAddEntryForThisSubdir);
1016struct CurlRequestHelper
1018 WriteFuncStruct sWriteFuncData{};
1019 WriteFuncStruct sWriteFuncHeaderData{};
1020 char szCurlErrBuf[CURL_ERROR_SIZE + 1] = {};
1022 CurlRequestHelper();
1023 ~CurlRequestHelper();
1024 long perform(CURL *hCurlHandle,
1025 struct curl_slist *headers,
1026 VSICurlFilesystemHandlerBase *poFS,
1027 IVSIS3LikeHandleHelper *poS3HandleHelper);
1034class NetworkStatisticsLogger
1036 static int gnEnabled;
1037 static NetworkStatisticsLogger gInstance;
1039 NetworkStatisticsLogger() =
default;
1041 std::mutex m_mutex{};
1050 GIntBig nGETDownloadedBytes = 0;
1051 GIntBig nPUTUploadedBytes = 0;
1052 GIntBig nPOSTDownloadedBytes = 0;
1053 GIntBig nPOSTUploadedBytes = 0;
1056 enum class ContextPathType
1063 struct ContextPathItem
1065 ContextPathType eType;
1068 ContextPathItem(ContextPathType eTypeIn,
const std::string &osNameIn)
1069 : eType(eTypeIn), osName(osNameIn)
1073 bool operator<(
const ContextPathItem &other)
const
1075 if (
static_cast<int>(eType) <
static_cast<int>(other.eType))
1077 if (
static_cast<int>(eType) >
static_cast<int>(other.eType))
1079 return osName < other.osName;
1085 Counters counters{};
1086 std::map<ContextPathItem, Stats> children{};
1094 std::map<GIntBig, std::vector<ContextPathItem>>
1095 m_mapThreadIdToContextPath{};
1097 static void ReadEnabled();
1099 std::vector<Counters *> GetCountersForContext();
1102 static inline bool IsEnabled()
1108 return gnEnabled == TRUE;
1111 static void EnterFileSystem(
const char *pszName);
1113 static void LeaveFileSystem();
1115 static void EnterFile(
const char *pszName);
1117 static void LeaveFile();
1119 static void EnterAction(
const char *pszName);
1121 static void LeaveAction();
1123 static void LogHEAD();
1125 static void LogGET(
size_t nDownloadedBytes);
1127 static void LogPUT(
size_t nUploadedBytes);
1129 static void LogPOST(
size_t nUploadedBytes,
size_t nDownloadedBytes);
1131 static void LogDELETE();
1133 static void Reset();
1135 static std::string GetReportAsSerializedJSON();
1138struct NetworkStatisticsFileSystem
1140 inline explicit NetworkStatisticsFileSystem(
const char *pszName)
1142 NetworkStatisticsLogger::EnterFileSystem(pszName);
1145 inline ~NetworkStatisticsFileSystem()
1147 NetworkStatisticsLogger::LeaveFileSystem();
1151struct NetworkStatisticsFile
1153 inline explicit NetworkStatisticsFile(
const char *pszName)
1155 NetworkStatisticsLogger::EnterFile(pszName);
1158 inline ~NetworkStatisticsFile()
1160 NetworkStatisticsLogger::LeaveFile();
1164struct NetworkStatisticsAction
1166 inline explicit NetworkStatisticsAction(
const char *pszName)
1168 NetworkStatisticsLogger::EnterAction(pszName);
1171 inline ~NetworkStatisticsAction()
1173 NetworkStatisticsLogger::LeaveAction();
1179int VSICURLGetDownloadChunkSize();
1181void VSICURLInitWriteFuncStruct(cpl::WriteFuncStruct *psStruct,
VSILFILE *fp,
1182 VSICurlReadCbkFunc pfnReadCbk,
1183 void *pReadCbkUserData);
1184size_t VSICurlHandleWriteFunc(
void *buffer,
size_t count,
size_t nmemb,
1186void VSICURLMultiPerform(CURLM *hCurlMultiHandle, CURL *hEasyHandle =
nullptr,
1187 std::atomic<bool> *pbInterrupt =
nullptr);
1188void VSICURLResetHeaderAndWriterFunctions(CURL *hCurlHandle);
1190int VSICurlParseUnixPermissions(
const char *pszPermissions);
1193bool VSICURLGetCachedFileProp(
const char *pszURL, cpl::FileProp &oFileProp);
1194void VSICURLSetCachedFileProp(
const char *pszURL, cpl::FileProp &oFileProp);
1195void VSICURLInvalidateCachedFileProp(
const char *pszURL);
1196void VSICURLInvalidateCachedFilePropPrefix(
const char *pszURL);
1197void VSICURLDestroyCacheFileProp();
1199void VSICURLMultiCleanup(CURLM *hCurlMultiHandle);
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition cpl_json.h:41
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:436
Interface for read and write JSON documents.
Core portability definitions for CPL.
#define CPL_NON_FINAL
Mark that a class is explicitly recognized as non-final.
Definition cpl_port.h:1023
#define EQUAL(a, b)
Alias for strcasecmp() == 0.
Definition cpl_port.h:535
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1179
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:169
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:199
Various convenience functions for working with strings and string lists.
#define VSIStatBufL
Type for VSIStatL()
Definition cpl_vsi.h:189
#define VSI_L_OFFSET_MAX
Maximum value for a file offset.
Definition cpl_vsi.h:132
struct VSIDIR VSIDIR
Opaque type for a directory iterator.
Definition cpl_vsi.h:388
GUIntBig vsi_l_offset
Type for a file offset.
Definition cpl_vsi.h:130
Virtual file handle.
Definition cpl_vsi_virtual.h:47