Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
19d2864c
Commit
19d2864c
authored
Feb 04, 2022
by
Max Kellermann
Committed by
Max Kellermann
Jul 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/curl/Headers: central type definition for the header map
parent
29e3a17f
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
90 additions
and
75 deletions
+90
-75
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+7
-9
CurlInputPlugin.hxx
src/input/plugins/CurlInputPlugin.hxx
+2
-5
QobuzClient.cxx
src/input/plugins/QobuzClient.cxx
+2
-2
QobuzClient.hxx
src/input/plugins/QobuzClient.hxx
+3
-3
QobuzErrorParser.cxx
src/input/plugins/QobuzErrorParser.cxx
+1
-1
QobuzErrorParser.hxx
src/input/plugins/QobuzErrorParser.hxx
+2
-5
QobuzLoginRequest.cxx
src/input/plugins/QobuzLoginRequest.cxx
+3
-4
QobuzLoginRequest.hxx
src/input/plugins/QobuzLoginRequest.hxx
+1
-1
QobuzTagScanner.cxx
src/input/plugins/QobuzTagScanner.cxx
+1
-2
QobuzTagScanner.hxx
src/input/plugins/QobuzTagScanner.hxx
+1
-1
QobuzTrackRequest.cxx
src/input/plugins/QobuzTrackRequest.cxx
+1
-1
QobuzTrackRequest.hxx
src/input/plugins/QobuzTrackRequest.hxx
+1
-1
Adapter.hxx
src/lib/curl/Adapter.hxx
+5
-8
Delegate.cxx
src/lib/curl/Delegate.cxx
+2
-3
Delegate.hxx
src/lib/curl/Delegate.hxx
+4
-8
Form.cxx
src/lib/curl/Form.cxx
+1
-2
Form.hxx
src/lib/curl/Form.hxx
+3
-3
Handler.hxx
src/lib/curl/Handler.hxx
+3
-8
Headers.hxx
src/lib/curl/Headers.hxx
+42
-0
Discovery.cxx
src/lib/upnp/Discovery.cxx
+1
-1
Discovery.hxx
src/lib/upnp/Discovery.hxx
+1
-2
CurlStorage.cxx
src/storage/plugins/CurlStorage.cxx
+2
-3
RunCurl.cxx
test/RunCurl.cxx
+1
-2
No files found.
src/input/plugins/CurlInputPlugin.cxx
View file @
19d2864c
...
...
@@ -82,7 +82,7 @@ class CurlInputStream final : public AsyncInputStream, CurlResponseHandler {
public
:
template
<
typename
I
>
CurlInputStream
(
EventLoop
&
event_loop
,
const
char
*
_url
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
,
const
Curl
::
Headers
&
headers
,
I
&&
_icy
,
Mutex
&
_mutex
);
...
...
@@ -92,7 +92,7 @@ public:
CurlInputStream
&
operator
=
(
const
CurlInputStream
&
)
=
delete
;
static
InputStreamPtr
Open
(
const
char
*
url
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
,
const
Curl
::
Headers
&
headers
,
Mutex
&
mutex
);
private
:
...
...
@@ -131,8 +131,7 @@ private:
void
SeekInternal
(
offset_type
new_offset
);
/* virtual methods from CurlResponseHandler */
void
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
override
;
void
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
override
;
void
OnData
(
ConstBuffer
<
void
>
data
)
override
;
void
OnEnd
()
override
;
void
OnError
(
std
::
exception_ptr
e
)
noexcept
override
;
...
...
@@ -227,7 +226,7 @@ WithConvertedTagValue(const char *uri, const char *value, F &&f) noexcept
void
CurlInputStream
::
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
Curl
::
Headers
&&
headers
)
{
assert
(
GetEventLoop
().
IsInside
());
assert
(
!
postponed_exception
);
...
...
@@ -391,7 +390,7 @@ input_curl_finish() noexcept
template
<
typename
I
>
inline
CurlInputStream
::
CurlInputStream
(
EventLoop
&
event_loop
,
const
char
*
_url
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
,
const
Curl
::
Headers
&
headers
,
I
&&
_icy
,
Mutex
&
_mutex
)
:
AsyncInputStream
(
event_loop
,
_url
,
_mutex
,
...
...
@@ -491,7 +490,7 @@ CurlInputStream::DoSeek(offset_type new_offset)
inline
InputStreamPtr
CurlInputStream
::
Open
(
const
char
*
url
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
,
const
Curl
::
Headers
&
headers
,
Mutex
&
mutex
)
{
auto
icy
=
std
::
make_shared
<
IcyMetaDataParser
>
();
...
...
@@ -510,8 +509,7 @@ CurlInputStream::Open(const char *url,
}
InputStreamPtr
OpenCurlInputStream
(
const
char
*
uri
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
,
OpenCurlInputStream
(
const
char
*
uri
,
const
Curl
::
Headers
&
headers
,
Mutex
&
mutex
)
{
return
CurlInputStream
::
Open
(
uri
,
headers
,
mutex
);
...
...
src/input/plugins/CurlInputPlugin.hxx
View file @
19d2864c
...
...
@@ -20,12 +20,10 @@
#ifndef MPD_INPUT_CURL_HXX
#define MPD_INPUT_CURL_HXX
#include "lib/curl/Headers.hxx"
#include "input/Ptr.hxx"
#include "thread/Mutex.hxx"
#include <string>
#include <map>
extern
const
struct
InputPlugin
input_plugin_curl
;
/**
...
...
@@ -36,8 +34,7 @@ extern const struct InputPlugin input_plugin_curl;
* Throws on error.
*/
InputStreamPtr
OpenCurlInputStream
(
const
char
*
uri
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
,
OpenCurlInputStream
(
const
char
*
uri
,
const
Curl
::
Headers
&
headers
,
Mutex
&
mutex
);
#endif
src/input/plugins/QobuzClient.cxx
View file @
19d2864c
...
...
@@ -164,7 +164,7 @@ QobuzClient::InvokeHandlers() noexcept
std
::
string
QobuzClient
::
MakeUrl
(
const
char
*
object
,
const
char
*
method
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
query
)
const
noexcept
const
Curl
::
Headers
&
query
)
const
noexcept
{
assert
(
!
query
.
empty
());
...
...
@@ -183,7 +183,7 @@ QobuzClient::MakeUrl(const char *object, const char *method,
std
::
string
QobuzClient
::
MakeSignedUrl
(
const
char
*
object
,
const
char
*
method
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
query
)
const
noexcept
const
Curl
::
Headers
&
query
)
const
noexcept
{
assert
(
!
query
.
empty
());
...
...
src/input/plugins/QobuzClient.hxx
View file @
19d2864c
...
...
@@ -23,12 +23,12 @@
#include "QobuzSession.hxx"
#include "QobuzLoginRequest.hxx"
#include "lib/curl/Init.hxx"
#include "lib/curl/Headers.hxx"
#include "thread/Mutex.hxx"
#include "event/DeferEvent.hxx"
#include "util/IntrusiveList.hxx"
#include <memory>
#include <map>
#include <string>
class
QobuzSessionHandler
...
...
@@ -94,10 +94,10 @@ public:
QobuzSession
GetSession
()
const
;
std
::
string
MakeUrl
(
const
char
*
object
,
const
char
*
method
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
query
)
const
noexcept
;
const
Curl
::
Headers
&
query
)
const
noexcept
;
std
::
string
MakeSignedUrl
(
const
char
*
object
,
const
char
*
method
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
query
)
const
noexcept
;
const
Curl
::
Headers
&
query
)
const
noexcept
;
private
:
void
StartLogin
();
...
...
src/input/plugins/QobuzErrorParser.cxx
View file @
19d2864c
...
...
@@ -38,7 +38,7 @@ static constexpr yajl_callbacks qobuz_error_parser_callbacks = {
};
QobuzErrorParser
::
QobuzErrorParser
(
unsigned
_status
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
)
const
Curl
::
Headers
&
headers
)
:
YajlResponseParser
(
&
qobuz_error_parser_callbacks
,
nullptr
,
this
),
status
(
_status
)
{
...
...
src/input/plugins/QobuzErrorParser.hxx
View file @
19d2864c
...
...
@@ -20,11 +20,9 @@
#ifndef QOBUZ_ERROR_PARSER_HXX
#define QOBUZ_ERROR_PARSER_HXX
#include "lib/curl/Headers.hxx"
#include "lib/yajl/ResponseParser.hxx"
#include <string>
#include <map>
template
<
typename
T
>
struct
ConstBuffer
;
struct
StringView
;
...
...
@@ -46,8 +44,7 @@ public:
* May throw if there is a formal error in the response
* headers.
*/
QobuzErrorParser
(
unsigned
status
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
);
QobuzErrorParser
(
unsigned
status
,
const
Curl
::
Headers
&
headers
);
protected
:
/* virtual methods from CurlResponseParser */
...
...
src/input/plugins/QobuzLoginRequest.cxx
View file @
19d2864c
...
...
@@ -77,7 +77,7 @@ QobuzLoginRequest::ResponseParser::GetSession()
return
std
::
move
(
session
);
}
static
std
::
multimap
<
std
::
string
,
std
::
string
>
static
Curl
::
Headers
MakeLoginForm
(
const
char
*
app_id
,
const
char
*
username
,
const
char
*
email
,
const
char
*
password
,
...
...
@@ -85,7 +85,7 @@ MakeLoginForm(const char *app_id,
{
assert
(
username
!=
nullptr
||
email
!=
nullptr
);
std
::
multimap
<
std
::
string
,
std
::
string
>
form
{
Curl
::
Headers
form
{
{
"app_id"
,
app_id
},
{
"password"
,
password
},
{
"device_manufacturer_id"
,
device_manufacturer_id
},
...
...
@@ -134,8 +134,7 @@ QobuzLoginRequest::~QobuzLoginRequest() noexcept
}
std
::
unique_ptr
<
CurlResponseParser
>
QobuzLoginRequest
::
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
QobuzLoginRequest
::
MakeParser
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
{
if
(
status
!=
200
)
return
std
::
make_unique
<
QobuzErrorParser
>
(
status
,
headers
);
...
...
src/input/plugins/QobuzLoginRequest.hxx
View file @
19d2864c
...
...
@@ -56,7 +56,7 @@ public:
private
:
/* virtual methods from DelegateCurlResponseHandler */
std
::
unique_ptr
<
CurlResponseParser
>
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
override
;
Curl
::
Headers
&&
headers
)
override
;
void
FinishParser
(
std
::
unique_ptr
<
CurlResponseParser
>
p
)
override
;
/* virtual methods from CurlResponseHandler */
...
...
src/input/plugins/QobuzTagScanner.cxx
View file @
19d2864c
...
...
@@ -99,8 +99,7 @@ QobuzTagScanner::~QobuzTagScanner() noexcept
}
std
::
unique_ptr
<
CurlResponseParser
>
QobuzTagScanner
::
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
QobuzTagScanner
::
MakeParser
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
{
if
(
status
!=
200
)
return
std
::
make_unique
<
QobuzErrorParser
>
(
status
,
headers
);
...
...
src/input/plugins/QobuzTagScanner.hxx
View file @
19d2864c
...
...
@@ -49,7 +49,7 @@ public:
private
:
/* virtual methods from DelegateCurlResponseHandler */
std
::
unique_ptr
<
CurlResponseParser
>
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
override
;
Curl
::
Headers
&&
headers
)
override
;
void
FinishParser
(
std
::
unique_ptr
<
CurlResponseParser
>
p
)
override
;
/* virtual methods from CurlResponseHandler */
...
...
src/input/plugins/QobuzTrackRequest.cxx
View file @
19d2864c
...
...
@@ -93,7 +93,7 @@ QobuzTrackRequest::~QobuzTrackRequest() noexcept
std
::
unique_ptr
<
CurlResponseParser
>
QobuzTrackRequest
::
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
Curl
::
Headers
&&
headers
)
{
if
(
status
!=
200
)
return
std
::
make_unique
<
QobuzErrorParser
>
(
status
,
headers
);
...
...
src/input/plugins/QobuzTrackRequest.hxx
View file @
19d2864c
...
...
@@ -56,7 +56,7 @@ public:
private
:
/* virtual methods from DelegateCurlResponseHandler */
std
::
unique_ptr
<
CurlResponseParser
>
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
override
;
Curl
::
Headers
&&
headers
)
override
;
void
FinishParser
(
std
::
unique_ptr
<
CurlResponseParser
>
p
)
override
;
/* virtual methods from CurlResponseHandler */
...
...
src/lib/curl/Adapter.hxx
View file @
19d2864c
/*
* Copyright 2008-202
1
Max Kellermann <max.kellermann@gmail.com>
* Copyright 2008-202
2
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -27,14 +27,13 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CURL_ADAPTER_HXX
#define CURL_ADAPTER_HXX
#pragma once
#include "Headers.hxx"
#include <curl/curl.h>
#include <cstddef>
#include <map>
#include <string>
struct
StringView
;
class
CurlEasy
;
...
...
@@ -45,7 +44,7 @@ class CurlResponseHandlerAdapter {
CurlResponseHandler
&
handler
;
std
::
multimap
<
std
::
string
,
std
::
string
>
headers
;
Curl
::
Headers
headers
;
/** error message provided by libcurl */
char
error_buffer
[
CURL_ERROR_SIZE
];
...
...
@@ -83,5 +82,3 @@ private:
std
::
size_t
size
,
std
::
size_t
nmemb
,
void
*
stream
)
noexcept
;
};
#endif
src/lib/curl/Delegate.cxx
View file @
19d2864c
/*
* Copyright
(C) 2008-2018
Max Kellermann <max.kellermann@gmail.com>
* Copyright
2008-2022
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -34,8 +34,7 @@
#include <utility>
void
DelegateCurlResponseHandler
::
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
DelegateCurlResponseHandler
::
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
{
parser
=
MakeParser
(
status
,
std
::
move
(
headers
));
assert
(
parser
);
...
...
src/lib/curl/Delegate.hxx
View file @
19d2864c
/*
* Copyright
(C) 2008-2018
Max Kellermann <max.kellermann@gmail.com>
* Copyright
2008-2022
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -27,8 +27,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CURL_DELEGATE_HXX
#define CURL_DELEGATE_HXX
#pragma once
#include "Handler.hxx"
...
...
@@ -53,7 +52,7 @@ protected:
* CurlResponseParser::OnError()).
*/
virtual
std
::
unique_ptr
<
CurlResponseParser
>
MakeParser
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
=
0
;
Curl
::
Headers
&&
headers
)
=
0
;
/**
* The parser has finished parsing the response body. This
...
...
@@ -64,10 +63,7 @@ protected:
virtual
void
FinishParser
(
std
::
unique_ptr
<
CurlResponseParser
>
p
)
=
0
;
public
:
void
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
final
;
void
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
final
;
void
OnData
(
ConstBuffer
<
void
>
data
)
final
;
void
OnEnd
()
final
;
};
#endif
src/lib/curl/Form.cxx
View file @
19d2864c
...
...
@@ -31,8 +31,7 @@
#include "String.hxx"
std
::
string
EncodeForm
(
CURL
*
curl
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
fields
)
noexcept
EncodeForm
(
CURL
*
curl
,
const
Curl
::
Headers
&
fields
)
noexcept
{
std
::
string
result
;
...
...
src/lib/curl/Form.hxx
View file @
19d2864c
...
...
@@ -30,17 +30,17 @@
#ifndef CURL_FORM_HXX
#define CURL_FORM_HXX
#include "Headers.hxx"
#include <curl/curl.h>
#include <string>
#include <map>
/**
* Encode the given map of form fields to a
* "application/x-www-form-urlencoded" string.
*/
std
::
string
EncodeForm
(
CURL
*
curl
,
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
fields
)
noexcept
;
EncodeForm
(
CURL
*
curl
,
const
Curl
::
Headers
&
fields
)
noexcept
;
#endif
src/lib/curl/Handler.hxx
View file @
19d2864c
...
...
@@ -27,14 +27,12 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CURL_HANDLER_HXX
#define CURL_HANDLER_HXX
#pragma once
#include "Headers.hxx"
#include "util/ConstBuffer.hxx"
#include <exception>
#include <string>
#include <map>
/**
* Asynchronous response handler for a #CurlRequest.
...
...
@@ -53,8 +51,7 @@ public:
/**
* Status line and headers have been received.
*/
virtual
void
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
=
0
;
virtual
void
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
=
0
;
/**
* Response body data has been received.
...
...
@@ -75,5 +72,3 @@ public:
*/
virtual
void
OnError
(
std
::
exception_ptr
e
)
noexcept
=
0
;
};
#endif
src/lib/curl/Headers.hxx
0 → 100644
View file @
19d2864c
/*
* Copyright 2020-2021 CM4all GmbH
* All rights reserved.
*
* author: Max Kellermann <mk@cm4all.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <map>
#include <string>
namespace
Curl
{
using
Headers
=
std
::
multimap
<
std
::
string
,
std
::
string
>
;
}
// namespace Curl
src/lib/upnp/Discovery.cxx
View file @
19d2864c
...
...
@@ -55,7 +55,7 @@ UPnPDeviceDirectory::Downloader::Destroy() noexcept
void
UPnPDeviceDirectory
::
Downloader
::
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
)
Curl
::
Headers
&&
)
{
if
(
status
!=
200
)
{
Destroy
();
...
...
src/lib/upnp/Discovery.hxx
View file @
19d2864c
...
...
@@ -113,8 +113,7 @@ class UPnPDeviceDirectory final : UpnpCallback {
}
/* virtual methods from CurlResponseHandler */
void
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
override
;
void
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
override
;
void
OnData
(
ConstBuffer
<
void
>
data
)
override
;
void
OnEnd
()
override
;
void
OnError
(
std
::
exception_ptr
e
)
noexcept
override
;
...
...
src/storage/plugins/CurlStorage.cxx
View file @
19d2864c
...
...
@@ -227,7 +227,7 @@ IsXmlContentType(const char *content_type) noexcept
gcc_pure
static
bool
IsXmlContentType
(
const
std
::
multimap
<
std
::
string
,
std
::
string
>
&
headers
)
noexcept
IsXmlContentType
(
const
Curl
::
Headers
&
headers
)
noexcept
{
auto
i
=
headers
.
find
(
"content-type"
);
return
i
!=
headers
.
end
()
&&
IsXmlContentType
(
i
->
second
.
c_str
());
...
...
@@ -297,8 +297,7 @@ private:
}
/* virtual methods from CurlResponseHandler */
void
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
final
{
void
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
final
{
if
(
status
!=
207
)
throw
FormatRuntimeError
(
"Status %d from WebDAV server; expected
\"
207 Multi-Status
\"
"
,
status
);
...
...
test/RunCurl.cxx
View file @
19d2864c
...
...
@@ -41,8 +41,7 @@ public:
}
/* virtual methods from CurlResponseHandler */
void
OnHeaders
(
unsigned
status
,
std
::
multimap
<
std
::
string
,
std
::
string
>
&&
headers
)
override
{
void
OnHeaders
(
unsigned
status
,
Curl
::
Headers
&&
headers
)
override
{
fprintf
(
stderr
,
"status: %u
\n
"
,
status
);
for
(
const
auto
&
i
:
headers
)
fprintf
(
stderr
,
"%s: %s
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment