29 #ifndef CPL_VSIL_CURL_CLASS_H_INCLUDED
30 #define CPL_VSIL_CURL_CLASS_H_INCLUDED
35 #include "cpl_azure.h"
39 #include "cpl_vsil_curl_priv.h"
40 #include "cpl_mem_cache.h"
42 #include "cpl_curl_priv.h"
45 #include <condition_variable>
61 #define HAVE_CURLINFO_REDIRECT_URL
63 void VSICurlStreamingClearCache(
void);
65 struct curl_slist *VSICurlSetOptions(CURL *hCurlHandle,
const char *pszURL,
66 const char *
const *papszOptions);
67 struct curl_slist *VSICurlMergeHeaders(
struct curl_slist *poDest,
68 struct curl_slist *poSrcToDestroy);
70 struct curl_slist *VSICurlSetContentTypeFromExt(
struct curl_slist *polist,
73 struct curl_slist *VSICurlSetCreationHeadersFromOptions(
74 struct curl_slist *headers,
CSLConstList papszOptions,
const char *pszPath);
89 unsigned int nGenerationAuthParameters = 0;
90 ExistStatus eExists = EXIST_UNKNOWN;
94 time_t nExpireTimestampLocal = 0;
95 std::string osRedirectURL{};
96 bool bHasComputedFileSize =
false;
97 bool bIsDirectory =
false;
99 bool bS3LikeRedirect =
false;
105 bool bGotFileList =
false;
106 unsigned int nGenerationAuthParameters = 0;
110 struct WriteFuncStruct
112 char *pBuffer =
nullptr;
114 bool bIsHTTP =
false;
115 bool bMultiRange =
false;
120 bool bFoundContentRange =
false;
122 bool bInterruptDownload =
false;
123 bool bDetectRangeDownloadingError =
false;
127 VSICurlReadCbkFunc pfnReadCbk =
nullptr;
128 void *pReadCbkUserData =
nullptr;
129 bool bInterrupted =
false;
134 const GByte *pabyData =
nullptr;
136 size_t nTotalSize = 0;
138 static size_t ReadCallBackBuffer(
char *buffer,
size_t size,
size_t nitems,
141 PutData *poThis =
static_cast<PutData *
>(instream);
142 const size_t nSizeMax = size * nitems;
143 const size_t nSizeToWrite =
144 std::min(nSizeMax, poThis->nTotalSize - poThis->nOff);
145 memcpy(buffer, poThis->pabyData + poThis->nOff, nSizeToWrite);
146 poThis->nOff += nSizeToWrite;
157 class VSICurlFilesystemHandlerBase :
public VSIFilesystemHandler
161 struct FilenameOffsetPair
163 std::string filename_;
166 FilenameOffsetPair(
const std::string &filename,
vsi_l_offset offset)
167 : filename_(filename), offset_(offset)
171 bool operator==(
const FilenameOffsetPair &other)
const
173 return filename_ == other.filename_ && offset_ == other.offset_;
177 struct FilenameOffsetPairHasher
179 std::size_t operator()(
const FilenameOffsetPair &k)
const
181 return std::hash<std::string>()(k.filename_) ^
182 std::hash<vsi_l_offset>()(k.offset_);
186 using RegionCacheType = lru11::Cache<
187 FilenameOffsetPair, std::shared_ptr<std::string>, lru11::NullLock,
190 typename std::list<lru11::KeyValuePair<
191 FilenameOffsetPair, std::shared_ptr<std::string>>>::iterator,
192 FilenameOffsetPairHasher>>;
194 std::unique_ptr<RegionCacheType>
195 m_poRegionCacheDoNotUseDirectly{};
197 RegionCacheType *GetRegionCache();
204 lru11::Cache<std::string, bool> oCacheFileProp;
206 int nCachedFilesInDirList = 0;
207 lru11::Cache<std::string, CachedDirList> oCacheDirList;
209 char **ParseHTMLFileList(
const char *pszFilename,
int nMaxFiles,
210 char *pszData,
bool *pbGotFileList);
215 struct RegionInDownload
218 std::condition_variable oCond{};
219 bool bDownloadInProgress =
false;
221 std::string osData{};
224 std::mutex m_oMutex{};
225 std::map<std::string, std::unique_ptr<RegionInDownload>>
226 m_oMapRegionInDownload{};
229 CPLMutex *hMutex =
nullptr;
231 virtual VSICurlHandle *CreateFileHandle(
const char *pszFilename);
232 virtual char **GetFileList(
const char *pszFilename,
int nMaxFiles,
233 bool *pbGotFileList);
235 void RegisterEmptyDir(
const std::string &osDirname);
238 AnalyseS3FileList(
const std::string &osBaseURL,
const char *pszXML,
240 const std::set<std::string> &oSetIgnoredStorageClasses,
243 void AnalyseSwiftFileList(
const std::string &osBaseURL,
244 const std::string &osPrefix,
const char *pszJson,
246 int nMaxFiles,
bool &bIsTruncated,
247 std::string &osNextMarker);
249 static const char *GetOptionsStatic();
251 VSICurlFilesystemHandlerBase();
254 ~VSICurlFilesystemHandlerBase()
override;
256 static bool IsAllowedFilename(
const char *pszFilename);
262 int Stat(
const char *pszFilename,
VSIStatBufL *pStatBuf,
263 int nFlags)
override;
264 int Unlink(
const char *pszFilename)
override;
265 int Rename(
const char *oldpath,
const char *newpath)
override;
266 int Mkdir(
const char *pszDirname,
long nMode)
override;
267 int Rmdir(
const char *pszDirname)
override;
268 char **ReadDirEx(
const char *pszDirname,
int nMaxFiles)
override;
269 char **SiblingFiles(
const char *pszFilename)
override;
271 int HasOptimizedReadMultiRange(
const char * )
override
276 const char *GetActualURL(
const char *pszFilename)
override;
278 const char *GetOptions()
override;
280 char **GetFileMetadata(
const char *pszFilename,
const char *pszDomain,
283 char **ReadDirInternal(
const char *pszDirname,
int nMaxFiles,
284 bool *pbGotFileList);
285 void InvalidateDirContent(
const char *pszDirname);
287 virtual const char *GetDebugKey()
const = 0;
289 virtual std::string GetFSPrefix()
const = 0;
290 virtual bool AllowCachedDataFor(
const char *pszFilename);
292 virtual bool IsLocal(
const char * )
override
298 SupportsSequentialWrite(
const char * ,
304 virtual bool SupportsRandomWrite(
const char * ,
310 std::shared_ptr<std::string> GetRegion(
const char *pszURL,
313 void AddRegion(
const char *pszURL,
vsi_l_offset nFileOffsetStart,
314 size_t nSize,
const char *pData);
316 std::pair<bool, std::string>
317 NotifyStartDownloadRegion(
const std::string &osURL,
319 void NotifyStopDownloadRegion(
const std::string &osURL,
321 const std::string &osData);
323 bool GetCachedFileProp(
const char *pszURL, FileProp &oFileProp);
324 void SetCachedFileProp(
const char *pszURL, FileProp &oFileProp);
325 void InvalidateCachedData(
const char *pszURL);
327 CURLM *GetCurlMultiHandleFor(
const std::string &osURL);
329 virtual void ClearCache();
330 virtual void PartialClearCache(
const char *pszFilename);
332 bool GetCachedDirList(
const char *pszURL, CachedDirList &oCachedDirList);
333 void SetCachedDirList(
const char *pszURL, CachedDirList &oCachedDirList);
334 bool ExistsInCacheDirList(
const std::string &osDirname,
bool *pbIsDir);
336 virtual std::string GetURLFromFilename(
const std::string &osFilename);
339 GetStreamingFilename(
const std::string &osFilename)
const override = 0;
341 static std::set<std::string> GetS3IgnoredStorageClasses();
344 class VSICurlFilesystemHandler :
public VSICurlFilesystemHandlerBase
349 VSICurlFilesystemHandler() =
default;
351 const char *GetDebugKey()
const override
356 std::string GetFSPrefix()
const override
362 GetStreamingFilename(
const std::string &osFilename)
const override;
374 VSICurlFilesystemHandlerBase *poFS =
nullptr;
376 bool m_bCached =
true;
378 mutable FileProp oFileProp{};
380 mutable std::mutex m_oMutex{};
381 std::string m_osFilename{};
382 char *m_pszURL =
nullptr;
383 mutable std::string m_osQueryString{};
386 CPLHTTPRetryParameters
390 int nBlocksToDownload = 1;
392 bool bStopOnInterruptUntilUninstall =
false;
393 bool bInterrupted =
false;
394 VSICurlReadCbkFunc pfnReadCbk =
nullptr;
395 void *pReadCbkUserData =
nullptr;
399 void DownloadRegionPostProcess(
const vsi_l_offset startOffset,
400 const int nBlocks,
const char *pBuffer,
409 virtual std::string DownloadRegion(
vsi_l_offset startOffset,
int nBlocks);
411 bool m_bUseHead =
false;
412 bool m_bUseRedirectURLIfNoQueryStringParams =
false;
416 mutable bool m_bPlanetaryComputerURLSigning =
false;
417 mutable std::string m_osPlanetaryComputerCollection{};
418 void ManagePlanetaryComputerSigning()
const;
420 int ReadMultiRangeSingleGet(
int nRanges,
void **ppData,
422 const size_t *panSizes);
423 std::string GetRedirectURLIfValid(
bool &bHasExpired)
const;
425 void UpdateRedirectInfo(CURL *hCurlHandle,
426 const WriteFuncStruct &sWriteFuncHeaderData);
429 struct AdviseReadRange
433 std::condition_variable oCV{};
436 std::vector<GByte> abyData{};
439 std::vector<std::unique_ptr<AdviseReadRange>> m_aoAdviseReadRanges{};
440 std::thread m_oThreadAdviseRead{};
443 virtual struct curl_slist *
444 GetCurlHeaders(
const std::string & ,
445 const struct curl_slist * )
450 virtual bool AllowAutomaticRedirection()
455 virtual bool CanRestartOnError(
const char *,
const char *,
bool)
460 virtual bool UseLimitRangeGetInsteadOfHead()
465 virtual bool IsDirectoryFromExists(
const char * ,
471 virtual void ProcessGetFileSizeResult(
const char * )
475 void SetURL(
const char *pszURL);
477 virtual bool Authenticate(
const char * )
483 VSICurlHandle(VSICurlFilesystemHandlerBase *poFS,
const char *pszFilename,
484 const char *pszURLIn =
nullptr);
485 ~VSICurlHandle()
override;
489 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
490 int ReadMultiRange(
int nRanges,
void **ppData,
492 const size_t *panSizes)
override;
493 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
494 void ClearErr()
override;
496 int Error()
override;
497 int Flush()
override;
498 int Close()
override;
500 bool HasPRead()
const override
505 size_t PRead(
void *pBuffer,
size_t nSize,
508 void AdviseRead(
int nRanges,
const vsi_l_offset *panOffsets,
509 const size_t *panSizes)
override;
511 size_t GetAdviseReadTotalBytesLimit()
const override;
513 bool IsKnownFileSize()
const
515 return oFileProp.bHasComputedFileSize;
518 vsi_l_offset GetFileSizeOrHeaders(
bool bSetError,
bool bGetHeaders);
522 return GetFileSizeOrHeaders(bSetError,
false);
525 bool Exists(
bool bSetError);
527 bool IsDirectory()
const
529 return oFileProp.bIsDirectory;
534 return oFileProp.nMode;
537 time_t GetMTime()
const
539 return oFileProp.mTime;
547 int InstallReadCbk(VSICurlReadCbkFunc pfnReadCbk,
void *pfnUserData,
548 int bStopOnInterruptUntilUninstall);
549 int UninstallReadCbk();
551 const char *GetURL()
const
561 class VSICurlFilesystemHandlerBaseWritable :
public VSICurlFilesystemHandlerBase
566 VSICurlFilesystemHandlerBaseWritable() =
default;
568 virtual VSIVirtualHandleUniquePtr
569 CreateWriteHandle(
const char *pszFilename,
CSLConstList papszOptions) = 0;
575 bool SupportsSequentialWrite(
const char * ,
581 bool SupportsRandomWrite(
const char * ,
589 class IVSIS3LikeFSHandler :
public VSICurlFilesystemHandlerBaseWritable
593 virtual int MkdirInternal(
const char *pszDirname,
long nMode,
597 char **GetFileList(
const char *pszFilename,
int nMaxFiles,
598 bool *pbGotFileList)
override;
600 virtual IVSIS3LikeHandleHelper *CreateHandleHelper(
const char *pszURI,
601 bool bAllowNoObject) = 0;
603 virtual int CopyObject(
const char *oldpath,
const char *newpath,
606 int RmdirRecursiveInternal(
const char *pszDirname,
int nBatchSize);
609 IsAllowedHeaderForObjectCreation(
const char * )
614 IVSIS3LikeFSHandler() =
default;
617 int Unlink(
const char *pszFilename)
override;
618 int Mkdir(
const char *pszDirname,
long nMode)
override;
619 int Rmdir(
const char *pszDirname)
override;
620 int Stat(
const char *pszFilename,
VSIStatBufL *pStatBuf,
621 int nFlags)
override;
622 int Rename(
const char *oldpath,
const char *newpath)
override;
624 virtual int CopyFile(
const char *pszSource,
const char *pszTarget,
626 const char *
const *papszOptions,
627 GDALProgressFunc pProgressFunc,
628 void *pProgressData)
override;
630 virtual int DeleteObject(
const char *pszFilename);
632 virtual int *DeleteObjectBatch(
CSLConstList papszFilesOrDirs);
634 bool Sync(
const char *pszSource,
const char *pszTarget,
635 const char *
const *papszOptions, GDALProgressFunc pProgressFunc,
636 void *pProgressData,
char ***ppapszOutputs)
override;
638 VSIDIR *OpenDir(
const char *pszPath,
int nRecurseDepth,
639 const char *
const *papszOptions)
override;
646 class IVSIS3LikeFSHandlerWithMultipartUpload :
public IVSIS3LikeFSHandler
651 IVSIS3LikeFSHandlerWithMultipartUpload() =
default;
654 virtual bool SupportsNonSequentialMultipartUpload()
const
659 virtual bool SupportsParallelMultipartUpload()
const
664 virtual bool SupportsMultipartAbort()
const = 0;
666 size_t GetUploadChunkSizeInBytes(
const char *pszFilename,
667 const char *pszSpecifiedValInBytes);
669 virtual int CopyFileRestartable(
const char *pszSource,
670 const char *pszTarget,
671 const char *pszInputPayload,
672 char **ppszOutputPayload,
674 GDALProgressFunc pProgressFunc,
675 void *pProgressData)
override;
681 virtual int GetMaximumPartCount()
690 virtual int GetMinimumPartSizeInMiB()
699 virtual int GetMaximumPartSizeInMiB()
701 #if SIZEOF_VOIDP == 8
711 virtual int GetDefaultPartSizeInMiB()
717 InitiateMultipartUpload(
const std::string &osFilename,
718 IVSIS3LikeHandleHelper *poS3HandleHelper,
719 const CPLHTTPRetryParameters &oRetryParameters,
723 UploadPart(
const std::string &osFilename,
int nPartNumber,
725 const void *pabyBuffer,
size_t nBufferSize,
726 IVSIS3LikeHandleHelper *poS3HandleHelper,
727 const CPLHTTPRetryParameters &oRetryParameters,
730 virtual bool CompleteMultipart(
731 const std::string &osFilename,
const std::string &osUploadID,
732 const std::vector<std::string> &aosEtags,
vsi_l_offset nTotalSize,
733 IVSIS3LikeHandleHelper *poS3HandleHelper,
734 const CPLHTTPRetryParameters &oRetryParameters);
736 virtual bool AbortMultipart(
const std::string &osFilename,
737 const std::string &osUploadID,
738 IVSIS3LikeHandleHelper *poS3HandleHelper,
739 const CPLHTTPRetryParameters &oRetryParameters);
741 bool AbortPendingUploads(
const char *pszFilename)
override;
743 bool MultipartUploadGetCapabilities(
int *pbNonSequentialUploadSupported,
744 int *pbParallelUploadSupported,
745 int *pbAbortSupported,
746 size_t *pnMinPartSize,
747 size_t *pnMaxPartSize,
748 int *pnMaxPartCount)
override;
750 char *MultipartUploadStart(
const char *pszFilename,
753 char *MultipartUploadAddPart(
const char *pszFilename,
754 const char *pszUploadId,
int nPartNumber,
759 bool MultipartUploadEnd(
const char *pszFilename,
const char *pszUploadId,
760 size_t nPartIdsCount,
761 const char *
const *apszPartIds,
765 bool MultipartUploadAbort(
const char *pszFilename,
const char *pszUploadId,
773 class IVSIS3LikeHandle :
public VSICurlHandle
778 bool UseLimitRangeGetInsteadOfHead()
override
783 bool IsDirectoryFromExists(
const char *pszVerb,
int response_code)
override
786 return response_code == 416 &&
EQUAL(pszVerb,
"GET") &&
787 std::string(m_pszURL).back() ==
'/';
790 void ProcessGetFileSizeResult(
const char *pszContent)
override
792 oFileProp.bIsDirectory =
793 strstr(pszContent,
"ListBucketResult") !=
nullptr;
797 IVSIS3LikeHandle(VSICurlFilesystemHandlerBase *poFSIn,
798 const char *pszFilename,
const char *pszURLIn)
799 : VSICurlHandle(poFSIn, pszFilename, pszURLIn)
803 ~IVSIS3LikeHandle()
override
816 IVSIS3LikeFSHandlerWithMultipartUpload *m_poFS =
nullptr;
817 std::string m_osFilename{};
818 IVSIS3LikeHandleHelper *m_poS3HandleHelper =
nullptr;
821 CPLHTTPRetryParameters m_oRetryParameters;
824 size_t m_nBufferOff = 0;
825 size_t m_nBufferSize = 0;
826 bool m_bClosed =
false;
827 GByte *m_pabyBuffer =
nullptr;
828 std::string m_osUploadID{};
829 int m_nPartNumber = 0;
830 std::vector<std::string> m_aosEtags{};
831 bool m_bError =
false;
833 WriteFuncStruct m_sWriteFuncHeaderData{};
836 bool DoSinglePartPUT();
838 void InvalidateParentDirectory();
841 VSIMultipartWriteHandle(IVSIS3LikeFSHandlerWithMultipartUpload *poFS,
842 const char *pszFilename,
843 IVSIS3LikeHandleHelper *poS3HandleHelper,
845 ~VSIMultipartWriteHandle()
override;
849 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
850 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
852 void ClearErr()
override
866 int Close()
override;
870 return m_pabyBuffer !=
nullptr;
885 IVSIS3LikeFSHandler *m_poFS =
nullptr;
886 std::string m_osFilename{};
887 IVSIS3LikeHandleHelper *m_poS3HandleHelper =
nullptr;
890 CPLHTTPRetryParameters m_oRetryParameters;
893 size_t m_nBufferOff = 0;
894 bool m_bError =
false;
895 bool m_bClosed =
false;
897 CURLM *m_hCurlMulti =
nullptr;
898 CURL *m_hCurl =
nullptr;
899 const void *m_pBuffer =
nullptr;
900 std::string m_osCurlErrBuf{};
901 size_t m_nChunkedBufferOff = 0;
902 size_t m_nChunkedBufferSize = 0;
903 size_t m_nWrittenInPUT = 0;
905 WriteFuncStruct m_sWriteFuncHeaderData{};
907 static size_t ReadCallBackBufferChunked(
char *buffer,
size_t size,
908 size_t nitems,
void *instream);
909 int FinishChunkedTransfer();
913 void InvalidateParentDirectory();
916 VSIChunkedWriteHandle(IVSIS3LikeFSHandler *poFS,
const char *pszFilename,
917 IVSIS3LikeHandleHelper *poS3HandleHelper,
919 virtual ~VSIChunkedWriteHandle();
923 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
924 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
926 void ClearErr()
override
940 int Close()
override;
952 VSICurlFilesystemHandlerBase *m_poFS =
nullptr;
953 std::string m_osFSPrefix{};
954 std::string m_osFilename{};
955 CPLHTTPRetryParameters m_oRetryParameters{};
958 int m_nBufferOff = 0;
959 int m_nBufferSize = 0;
960 int m_nBufferOffReadCallback = 0;
961 bool m_bClosed =
false;
962 GByte *m_pabyBuffer =
nullptr;
963 bool m_bError =
false;
965 static size_t ReadCallBackBuffer(
char *buffer,
size_t size,
size_t nitems,
967 virtual bool Send(
bool bIsLastBlock) = 0;
970 VSIAppendWriteHandle(VSICurlFilesystemHandlerBase *poFS,
971 const char *pszFSPrefix,
const char *pszFilename,
973 virtual ~VSIAppendWriteHandle();
977 size_t Read(
void *pBuffer,
size_t nSize,
size_t nMemb)
override;
978 size_t Write(
const void *pBuffer,
size_t nSize,
size_t nMemb)
override;
980 void ClearErr()
override
994 int Close()
override;
998 return m_pabyBuffer !=
nullptr;
1006 struct VSIDIRWithMissingDirSynthesis :
public VSIDIR
1008 std::vector<std::unique_ptr<VSIDIREntry>> aoEntries{};
1011 std::vector<std::string> m_aosSubpathsStack{};
1013 void SynthetizeMissingDirectories(
const std::string &osCurSubdir,
1014 bool bAddEntryForThisSubdir);
1021 struct CurlRequestHelper
1023 WriteFuncStruct sWriteFuncData{};
1024 WriteFuncStruct sWriteFuncHeaderData{};
1025 char szCurlErrBuf[CURL_ERROR_SIZE + 1] = {};
1027 CurlRequestHelper();
1028 ~CurlRequestHelper();
1029 long perform(CURL *hCurlHandle,
1030 struct curl_slist *headers,
1031 VSICurlFilesystemHandlerBase *poFS,
1032 IVSIS3LikeHandleHelper *poS3HandleHelper);
1039 class NetworkStatisticsLogger
1041 static int gnEnabled;
1042 static NetworkStatisticsLogger gInstance;
1044 NetworkStatisticsLogger() =
default;
1046 std::mutex m_mutex{};
1055 GIntBig nGETDownloadedBytes = 0;
1056 GIntBig nPUTUploadedBytes = 0;
1057 GIntBig nPOSTDownloadedBytes = 0;
1058 GIntBig nPOSTUploadedBytes = 0;
1061 enum class ContextPathType
1068 struct ContextPathItem
1070 ContextPathType eType;
1073 ContextPathItem(ContextPathType eTypeIn,
const std::string &osNameIn)
1074 : eType(eTypeIn), osName(osNameIn)
1078 bool operator<(
const ContextPathItem &other)
const
1080 if (
static_cast<int>(eType) <
static_cast<int>(other.eType))
1082 if (
static_cast<int>(eType) >
static_cast<int>(other.eType))
1084 return osName < other.osName;
1090 Counters counters{};
1091 std::map<ContextPathItem, Stats> children{};
1099 std::map<GIntBig, std::vector<ContextPathItem>>
1100 m_mapThreadIdToContextPath{};
1102 static void ReadEnabled();
1104 std::vector<Counters *> GetCountersForContext();
1107 static inline bool IsEnabled()
1113 return gnEnabled == TRUE;
1116 static void EnterFileSystem(
const char *pszName);
1118 static void LeaveFileSystem();
1120 static void EnterFile(
const char *pszName);
1122 static void LeaveFile();
1124 static void EnterAction(
const char *pszName);
1126 static void LeaveAction();
1128 static void LogHEAD();
1130 static void LogGET(
size_t nDownloadedBytes);
1132 static void LogPUT(
size_t nUploadedBytes);
1134 static void LogPOST(
size_t nUploadedBytes,
size_t nDownloadedBytes);
1136 static void LogDELETE();
1138 static void Reset();
1140 static std::string GetReportAsSerializedJSON();
1143 struct NetworkStatisticsFileSystem
1145 inline explicit NetworkStatisticsFileSystem(
const char *pszName)
1147 NetworkStatisticsLogger::EnterFileSystem(pszName);
1150 inline ~NetworkStatisticsFileSystem()
1152 NetworkStatisticsLogger::LeaveFileSystem();
1156 struct NetworkStatisticsFile
1158 inline explicit NetworkStatisticsFile(
const char *pszName)
1160 NetworkStatisticsLogger::EnterFile(pszName);
1163 inline ~NetworkStatisticsFile()
1165 NetworkStatisticsLogger::LeaveFile();
1169 struct NetworkStatisticsAction
1171 inline explicit NetworkStatisticsAction(
const char *pszName)
1173 NetworkStatisticsLogger::EnterAction(pszName);
1176 inline ~NetworkStatisticsAction()
1178 NetworkStatisticsLogger::LeaveAction();
1184 int VSICURLGetDownloadChunkSize();
1186 void VSICURLInitWriteFuncStruct(cpl::WriteFuncStruct *psStruct,
VSILFILE *fp,
1187 VSICurlReadCbkFunc pfnReadCbk,
1188 void *pReadCbkUserData);
1189 size_t VSICurlHandleWriteFunc(
void *buffer,
size_t count,
size_t nmemb,
1191 void VSICURLMultiPerform(CURLM *hCurlMultiHandle, CURL *hEasyHandle =
nullptr);
1192 void VSICURLResetHeaderAndWriterFunctions(CURL *hCurlHandle);
1194 int VSICurlParseUnixPermissions(
const char *pszPermissions);
1197 bool VSICURLGetCachedFileProp(
const char *pszURL, cpl::FileProp &oFileProp);
1198 void VSICURLSetCachedFileProp(
const char *pszURL, cpl::FileProp &oFileProp);
1199 void VSICURLInvalidateCachedFileProp(
const char *pszURL);
1200 void VSICURLInvalidateCachedFilePropPrefix(
const char *pszURL);
1201 void VSICURLDestroyCacheFileProp();
1203 void VSICURLMultiCleanup(CURLM *hCurlMultiHandle);
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:57
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:449
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:1035
#define EQUAL(a, b)
Alias for strcasecmp() == 0.
Definition: cpl_port.h:551
#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:1042
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:215
Various convenience functions for working with strings and string lists.
#define VSIStatBufL
Type for VSIStatL()
Definition: cpl_vsi.h:205
#define VSI_L_OFFSET_MAX
Maximum value for a file offset.
Definition: cpl_vsi.h:148
struct VSIDIR VSIDIR
Opaque type for a directory iterator.
Definition: cpl_vsi.h:404
GUIntBig vsi_l_offset
Type for a file offset.
Definition: cpl_vsi.h:146
Virtual file handle.
Definition: cpl_vsi_virtual.h:63