|
|
|
@ -10,13 +10,6 @@
@@ -10,13 +10,6 @@
|
|
|
|
|
#include <algorithm> |
|
|
|
|
#include <ctime> |
|
|
|
|
|
|
|
|
|
#ifdef ANDROID |
|
|
|
|
# include "to_string.h" |
|
|
|
|
# include <errno.h> |
|
|
|
|
#else |
|
|
|
|
# define to_string(x) std::to_string(x) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
namespace i2p { |
|
|
|
|
namespace http { |
|
|
|
|
const std::vector<std::string> HTTP_METHODS = { |
|
|
|
@ -187,11 +180,7 @@ namespace http {
@@ -187,11 +180,7 @@ namespace http {
|
|
|
|
|
out += user + "@"; |
|
|
|
|
} |
|
|
|
|
if (port) { |
|
|
|
|
#ifndef ANDROID |
|
|
|
|
out += host + ":" + to_string(port); |
|
|
|
|
#else |
|
|
|
|
out += host + ":" + tostr::to_string(port); |
|
|
|
|
#endif |
|
|
|
|
out += host + ":" + std::to_string(port); |
|
|
|
|
} else { |
|
|
|
|
out += host; |
|
|
|
|
} |
|
|
|
@ -349,11 +338,7 @@ namespace http {
@@ -349,11 +338,7 @@ namespace http {
|
|
|
|
|
if (status == "OK" && code != 200) |
|
|
|
|
status = HTTPCodeToStatus(code); // update
|
|
|
|
|
if (body.length() > 0 && headers.count("Content-Length") == 0) |
|
|
|
|
#ifndef ANDROID |
|
|
|
|
add_header("Content-Length", to_string(body.length()).c_str()); |
|
|
|
|
#else |
|
|
|
|
add_header("Content-Length", tostr::to_string(body.length()).c_str()); |
|
|
|
|
#endif |
|
|
|
|
add_header("Content-Length", std::to_string(body.length()).c_str()); |
|
|
|
|
/* build response */ |
|
|
|
|
std::stringstream ss; |
|
|
|
|
ss << version << " " << code << " " << status << CRLF; |
|
|
|
|