From 3dad4fc2be9e0ae6de995dde95bc2081da9c09e1 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Wed, 30 Jan 2019 11:12:21 +0100 Subject: [PATCH] Resync yahttp code to cmouse/yahttp@11be77a1fc4032ed268cb5a80eb2aa1d14ce849d --- ext/yahttp/README.md | 2 +- ext/yahttp/yahttp/exception.hpp | 6 +----- ext/yahttp/yahttp/reqresp.cpp | 2 +- ext/yahttp/yahttp/router.hpp | 5 +---- ext/yahttp/yahttp/url.hpp | 4 +--- ext/yahttp/yahttp/utility.hpp | 5 +---- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/ext/yahttp/README.md b/ext/yahttp/README.md index 7cd9e3562c..86794b5343 100644 --- a/ext/yahttp/README.md +++ b/ext/yahttp/README.md @@ -5,7 +5,7 @@ YaHTTP aims to be a pure http request/response parser that has no IO ties. It is [![Build Status](https://travis-ci.org/cmouse/yahttp.svg?branch=master)](https://travis-ci.org/cmouse/yahttp) [![Coverity Scan Build Status](https://scan.coverity.com/projects/2161/badge.svg)](https://scan.coverity.com/projects/2161) -[![Coverage Status](https://coveralls.io/repos/cmouse/yahttp/badge.svg?branch=master%0A)](https://coveralls.io/r/cmouse/yahttp?branch=master%0A) +[![Coverage Status](https://coveralls.io/repos/github/cmouse/yahttp/badge.svg)](https://coveralls.io/github/cmouse/yahttp) WARNINGS -------- diff --git a/ext/yahttp/yahttp/exception.hpp b/ext/yahttp/yahttp/exception.hpp index 72a048a328..d0ea0fea2d 100644 --- a/ext/yahttp/yahttp/exception.hpp +++ b/ext/yahttp/yahttp/exception.hpp @@ -1,6 +1,4 @@ -#ifndef _YAHTTP_EXCEPTION_HPP -#define _YAHTTP_EXCEPTION_HPP 1 - +#pragma once #include namespace YaHTTP { @@ -24,5 +22,3 @@ namespace YaHTTP { ParseError(const std::string& reason_): Error(reason_) {}; }; }; - -#endif diff --git a/ext/yahttp/yahttp/reqresp.cpp b/ext/yahttp/yahttp/reqresp.cpp index 92fc6480a7..beeb4d5020 100644 --- a/ext/yahttp/yahttp/reqresp.cpp +++ b/ext/yahttp/yahttp/reqresp.cpp @@ -262,7 +262,7 @@ namespace YaHTTP { os << "; "; os << Utility::encodeURL(i->second.name) << "=" << Utility::encodeURL(i->second.value); } - } else if (kind == YAHTTP_TYPE_REQUEST) { + } else if (kind == YAHTTP_TYPE_RESPONSE) { for(strcookie_map_t::const_iterator i = jar.cookies.begin(); i != jar.cookies.end(); i++) { os << "Set-Cookie: "; os << i->second.str() << "\r\n"; diff --git a/ext/yahttp/yahttp/router.hpp b/ext/yahttp/yahttp/router.hpp index 145123b9fa..a0dbd1380e 100644 --- a/ext/yahttp/yahttp/router.hpp +++ b/ext/yahttp/yahttp/router.hpp @@ -1,5 +1,4 @@ -#ifndef _YAHTTP_ROUTER_HPP -#define _YAHTTP_ROUTER_HPP 1 +#pragma once /* @file * @brief Defines router class and support structures */ @@ -71,5 +70,3 @@ If method is left empty, it will match any method. Name is also optional, but ne }; }; #endif - -#endif diff --git a/ext/yahttp/yahttp/url.hpp b/ext/yahttp/yahttp/url.hpp index e3225ea4f6..0002c29339 100644 --- a/ext/yahttp/yahttp/url.hpp +++ b/ext/yahttp/yahttp/url.hpp @@ -1,5 +1,4 @@ -#ifndef _YAHTTP_URL_HPP -#define _YAHTTP_URL_HPP 1 +#pragma once #include #include @@ -188,4 +187,3 @@ namespace YaHTTP { }; }; }; -#endif diff --git a/ext/yahttp/yahttp/utility.hpp b/ext/yahttp/yahttp/utility.hpp index 7d485359e0..8a93ae6d43 100644 --- a/ext/yahttp/yahttp/utility.hpp +++ b/ext/yahttp/yahttp/utility.hpp @@ -1,6 +1,4 @@ -#ifndef _YAHTTP_UTILITY_HPP -#define _YAHTTP_UTILITY_HPP 1 - +#pragma once namespace YaHTTP { static const char *MONTHS[] = {0,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",0}; // Content-Type }; }; -#endif -- 2.47.2