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