mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
moved std::to_string to util.h from android
This commit is contained in:
parent
07cc547bab
commit
a5be4c9d0e
7 changed files with 19 additions and 54 deletions
19
HTTP.cpp
19
HTTP.cpp
|
@ -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 {
|
|||
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 {
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue