Line data Source code
1 : /***************************************************************************** 2 : * 3 : * Project: WMS Client Driver 4 : * Purpose: Implementation of Dataset and RasterBand classes for WMS 5 : * and other similar services. 6 : * Author: Adam Nowacki, nowak@xpam.de 7 : * 8 : ****************************************************************************** 9 : * Copyright (c) 2007, Adam Nowacki 10 : * 11 : * SPDX-License-Identifier: MIT 12 : ****************************************************************************/ 13 : 14 : #ifndef GDALHTTP_H 15 : #define GDALHTTP_H 16 : 17 : #include "cpl_port.h" 18 : #include "cpl_http.h" 19 : 20 : struct WMSHTTPRequest 21 : { 22 56 : WMSHTTPRequest() 23 56 : : options(nullptr), nStatus(0), pabyData(nullptr), nDataLen(0), 24 56 : nDataAlloc(0), m_curl_handle(nullptr), m_headers(nullptr), x(0), y(0) 25 : { 26 56 : } 27 : 28 : ~WMSHTTPRequest(); 29 : 30 : /* Input */ 31 : CPLString URL; 32 : // Not owned, do not release 33 : const char *const *options; 34 : CPLString Range; 35 : 36 : /* Output */ 37 : CPLString ContentType; 38 : CPLString Error; 39 : 40 : int nStatus; /* 200 = success, 404 = not found, 0 = no response / error */ 41 : GByte *pabyData; 42 : size_t nDataLen; 43 : size_t nDataAlloc; 44 : 45 : /* curl internal stuff */ 46 : CURL *m_curl_handle; 47 : struct curl_slist *m_headers; 48 : // Which tile is being requested 49 : int x, y; 50 : 51 : // Space for error message, doesn't seem to be used by the multi-request 52 : // interface 53 : std::vector<char> m_curl_error; 54 : }; 55 : 56 : // Not public, only for use within WMS 57 : void WMSHTTPInitializeRequest(WMSHTTPRequest *psRequest); 58 : CPLErr WMSHTTPFetchMulti(WMSHTTPRequest *psRequest, int nRequestCount = 1); 59 : 60 : #endif /* GDALHTTP_H */