mirror of https://github.com/CrowCpp/Crow.git
removing some boost includes, fixing version checks and further phase out boost.
This commit is contained in:
parent
df92d6d639
commit
5b1c5a9e9e
|
@ -1,8 +1,6 @@
|
|||
#pragma once
|
||||
#define ASIO_STANDALONE
|
||||
#include <asio.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <vector>
|
||||
|
@ -590,7 +588,7 @@ namespace crow
|
|||
Adaptor adaptor_;
|
||||
Handler* handler_;
|
||||
|
||||
boost::array<char, 4096> buffer_;
|
||||
std::array<char, 4096> buffer_;
|
||||
|
||||
HTTPParser<Connection> parser_;
|
||||
request req_;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#define ASIO_STANDALONE
|
||||
#include <asio.hpp>
|
||||
#ifdef CROW_ENABLE_SSL
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
#include "crow/http_parser_merged.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
#include <asio/ssl.hpp>
|
||||
#endif
|
||||
#include "crow/settings.h"
|
||||
#if BOOST_VERSION >= 107000
|
||||
#include <asio/version.hpp>
|
||||
#if ASIO_VERSION >= 101300 // 1.13.0
|
||||
#define GET_IO_SERVICE(s) ((asio::io_context&)(s).get_executor().context())
|
||||
#else
|
||||
#define GET_IO_SERVICE(s) ((s).get_io_service())
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <array>
|
||||
#include "crow/logging.h"
|
||||
#include "crow/socket_adaptors.h"
|
||||
#include "crow/http_request.h"
|
||||
|
@ -664,7 +663,7 @@ namespace crow
|
|||
std::vector<std::string> sending_buffers_;
|
||||
std::vector<std::string> write_buffers_;
|
||||
|
||||
boost::array<char, 4096> buffer_;
|
||||
std::array<char, 4096> buffer_;
|
||||
bool is_binary_;
|
||||
std::string message_;
|
||||
std::string fragment_;
|
||||
|
|
|
@ -1702,9 +1702,15 @@ TEST_CASE("middleware_cookieparser_format")
|
|||
}
|
||||
// expires
|
||||
{
|
||||
auto tp = boost::posix_time::time_from_string("2000-11-01 23:59:59.000");
|
||||
std::time_t tp;
|
||||
std::time(&tp);
|
||||
std::tm* tm = std::gmtime(&tp);
|
||||
std::istringstream ss("2000-11-01 23:59:59");
|
||||
ss >> std::get_time(tm, "%Y-%m-%d %H:%M:%S");
|
||||
std::mktime(tm);
|
||||
|
||||
auto c = Cookie("key", "value")
|
||||
.expires(boost::posix_time::to_tm(tp));
|
||||
.expires(*tm);
|
||||
auto s = c.dump();
|
||||
CHECK(valid(s, 2));
|
||||
CHECK(s.find("Expires=Wed, 01 Nov 2000 23:59:59 GMT") != std::string::npos);
|
||||
|
|
Loading…
Reference in New Issue