Fixes #270 : compilation error when using gcc4.8
This commit is contained in:
parent
15145152c0
commit
6185e89e25
2 changed files with 7 additions and 7 deletions
|
|
@ -199,7 +199,7 @@ namespace SimpleWeb {
|
|||
/// If reusing the io_service for other tasks, use the asynchronous request functions instead.
|
||||
/// Do not use concurrently with the asynchronous request functions.
|
||||
/// When requesting Server-Sent Events: will throw on error::eof, please use asynchronous request functions instead.
|
||||
std::shared_ptr<Response> request(const std::string &method, const std::string &path = {"/"}, string_view content = {}, const CaseInsensitiveMultimap &header = {}) {
|
||||
std::shared_ptr<Response> request(const std::string &method, const std::string &path = {"/"}, string_view content = {}, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
std::shared_ptr<Response> response;
|
||||
error_code ec;
|
||||
request(method, path, content, header, [&response, &ec](std::shared_ptr<Response> response_, const error_code &ec_) {
|
||||
|
|
@ -229,7 +229,7 @@ namespace SimpleWeb {
|
|||
/// If reusing the io_service for other tasks, use the asynchronous request functions instead.
|
||||
/// Do not use concurrently with the asynchronous request functions.
|
||||
/// When requesting Server-Sent Events: will throw on error::eof, please use asynchronous request functions instead.
|
||||
std::shared_ptr<Response> request(const std::string &method, const std::string &path, std::istream &content, const CaseInsensitiveMultimap &header = {}) {
|
||||
std::shared_ptr<Response> request(const std::string &method, const std::string &path, std::istream &content, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
std::shared_ptr<Response> response;
|
||||
error_code ec;
|
||||
request(method, path, content, header, [&response, &ec](std::shared_ptr<Response> response_, const error_code &ec_) {
|
||||
|
|
|
|||
|
|
@ -144,13 +144,13 @@ namespace SimpleWeb {
|
|||
}
|
||||
|
||||
/// Convenience function for writing status line, potential header fields, and empty content
|
||||
void write(StatusCode status_code = StatusCode::success_ok, const CaseInsensitiveMultimap &header = {}) {
|
||||
void write(StatusCode status_code = StatusCode::success_ok, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
*this << "HTTP/1.1 " << SimpleWeb::status_code(status_code) << "\r\n";
|
||||
write_header(header, 0);
|
||||
}
|
||||
|
||||
/// Convenience function for writing status line, header fields, and content
|
||||
void write(StatusCode status_code, string_view content, const CaseInsensitiveMultimap &header = {}) {
|
||||
void write(StatusCode status_code, string_view content, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
*this << "HTTP/1.1 " << SimpleWeb::status_code(status_code) << "\r\n";
|
||||
write_header(header, content.size());
|
||||
if(!content.empty())
|
||||
|
|
@ -158,7 +158,7 @@ namespace SimpleWeb {
|
|||
}
|
||||
|
||||
/// Convenience function for writing status line, header fields, and content
|
||||
void write(StatusCode status_code, std::istream &content, const CaseInsensitiveMultimap &header = {}) {
|
||||
void write(StatusCode status_code, std::istream &content, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
*this << "HTTP/1.1 " << SimpleWeb::status_code(status_code) << "\r\n";
|
||||
content.seekg(0, std::ios::end);
|
||||
auto size = content.tellg();
|
||||
|
|
@ -169,12 +169,12 @@ namespace SimpleWeb {
|
|||
}
|
||||
|
||||
/// Convenience function for writing success status line, header fields, and content
|
||||
void write(string_view content, const CaseInsensitiveMultimap &header = {}) {
|
||||
void write(string_view content, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
write(StatusCode::success_ok, content, header);
|
||||
}
|
||||
|
||||
/// Convenience function for writing success status line, header fields, and content
|
||||
void write(std::istream &content, const CaseInsensitiveMultimap &header = {}) {
|
||||
void write(std::istream &content, const CaseInsensitiveMultimap &header = CaseInsensitiveMultimap()) {
|
||||
write(StatusCode::success_ok, content, header);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue