Coverage Report

Created: 2025-12-31 08:30

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/frmts/wms/gdalhttp.h
Line
Count
Source
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
2.94k
    WMSHTTPRequest() = default;
23
24
    ~WMSHTTPRequest();
25
    WMSHTTPRequest(const WMSHTTPRequest &) = delete;
26
    WMSHTTPRequest &operator=(const WMSHTTPRequest &) = delete;
27
    WMSHTTPRequest(WMSHTTPRequest &&) = delete;
28
    WMSHTTPRequest &operator=(WMSHTTPRequest &&) = delete;
29
30
    /* Input */
31
    CPLString URL{};
32
    // Not owned, do not release
33
    const char *const *options{nullptr};
34
    CPLString Range{};
35
36
    /* Output */
37
    CPLString ContentType{};
38
    CPLString Error{};
39
40
    int nStatus =
41
        0; /* 200 = success, 404 = not found, 0 = no response / error */
42
    GByte *pabyData{nullptr};
43
    size_t nDataLen{};
44
    size_t nDataAlloc{};
45
46
    /* curl internal stuff */
47
    CURL *m_curl_handle{nullptr};
48
    struct curl_slist *m_headers{nullptr};
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 */