mirror of https://github.com/kiwix/libkiwix.git
Got rid of RequestContext::accept_range
This commit is contained in:
parent
a0f7f32570
commit
e6a86c02ae
|
@ -75,7 +75,6 @@ RequestContext::RequestContext(struct MHD_Connection* connection,
|
||||||
version(version),
|
version(version),
|
||||||
requestIndex(s_requestIndex++),
|
requestIndex(s_requestIndex++),
|
||||||
acceptEncodingDeflate(false),
|
acceptEncodingDeflate(false),
|
||||||
accept_range(false),
|
|
||||||
range_pair(0, -1)
|
range_pair(0, -1)
|
||||||
{
|
{
|
||||||
MHD_get_connection_values(connection, MHD_HEADER_KIND, &RequestContext::fill_header, this);
|
MHD_get_connection_values(connection, MHD_HEADER_KIND, &RequestContext::fill_header, this);
|
||||||
|
@ -113,7 +112,6 @@ void RequestContext::parse_byte_range(std::string range)
|
||||||
end = -1;
|
end = -1;
|
||||||
}
|
}
|
||||||
if (iss.eof()) {
|
if (iss.eof()) {
|
||||||
accept_range = true;
|
|
||||||
range_pair = std::pair<int, int>(start, end);
|
range_pair = std::pair<int, int>(start, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +153,7 @@ void RequestContext::print_debug_info() const {
|
||||||
printf("full_url: %s\n", full_url.c_str());
|
printf("full_url: %s\n", full_url.c_str());
|
||||||
printf("url : %s\n", url.c_str());
|
printf("url : %s\n", url.c_str());
|
||||||
printf("acceptEncodingDeflate : %d\n", acceptEncodingDeflate);
|
printf("acceptEncodingDeflate : %d\n", acceptEncodingDeflate);
|
||||||
printf("has_range : %d\n", accept_range);
|
printf("has_range : %d\n", has_range());
|
||||||
printf("is_valid_url : %d\n", is_valid_url());
|
printf("is_valid_url : %d\n", is_valid_url());
|
||||||
printf(".............\n");
|
printf(".............\n");
|
||||||
}
|
}
|
||||||
|
@ -198,7 +196,7 @@ bool RequestContext::is_valid_url() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RequestContext::has_range() const {
|
bool RequestContext::has_range() const {
|
||||||
return accept_range;
|
return range_pair.first <= range_pair.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<int, int> RequestContext::get_range() const {
|
std::pair<int, int> RequestContext::get_range() const {
|
||||||
|
|
|
@ -98,7 +98,6 @@ class RequestContext {
|
||||||
|
|
||||||
bool acceptEncodingDeflate;
|
bool acceptEncodingDeflate;
|
||||||
|
|
||||||
bool accept_range;
|
|
||||||
ByteRange range_pair;
|
ByteRange range_pair;
|
||||||
std::map<std::string, std::string> headers;
|
std::map<std::string, std::string> headers;
|
||||||
std::map<std::string, std::string> arguments;
|
std::map<std::string, std::string> arguments;
|
||||||
|
|
Loading…
Reference in New Issue