mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
* HTTP.{cpp,h} : move length() method to base class
This commit is contained in:
parent
57bb0da1d6
commit
2e1a9a8df9
2
HTTP.cpp
2
HTTP.cpp
@ -279,7 +279,7 @@ namespace http {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
long int HTTPRes::length() {
|
long int HTTPMsg::length() {
|
||||||
unsigned long int length = 0;
|
unsigned long int length = 0;
|
||||||
auto it = headers.find("Content-Length");
|
auto it = headers.find("Content-Length");
|
||||||
if (it == headers.end())
|
if (it == headers.end())
|
||||||
|
6
HTTP.h
6
HTTP.h
@ -59,6 +59,9 @@ namespace http {
|
|||||||
|
|
||||||
void add_header(const char *name, const char *value, bool replace = false);
|
void add_header(const char *name, const char *value, bool replace = false);
|
||||||
void del_header(const char *name);
|
void del_header(const char *name);
|
||||||
|
|
||||||
|
/** @brief Returns declared message length or -1 if unknown */
|
||||||
|
long int length();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HTTPReq : HTTPMsg {
|
struct HTTPReq : HTTPMsg {
|
||||||
@ -113,9 +116,6 @@ namespace http {
|
|||||||
|
|
||||||
/** @brief Checks that response declared as chunked data */
|
/** @brief Checks that response declared as chunked data */
|
||||||
bool is_chunked();
|
bool is_chunked();
|
||||||
|
|
||||||
/** @brief Returns declared response length or -1 if unknown */
|
|
||||||
long int length();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user