From a0f7f32570a67a3618c9e940c604a8b2db6e14aa Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Sat, 23 May 2020 17:11:26 +0400 Subject: [PATCH] Re-ordered function definitions --- src/server/request_context.cpp | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/server/request_context.cpp b/src/server/request_context.cpp index a242b742f..996a7cc9c 100644 --- a/src/server/request_context.cpp +++ b/src/server/request_context.cpp @@ -92,34 +92,34 @@ RequestContext::RequestContext(struct MHD_Connection* connection, } catch (const std::out_of_range&) {} } -void RequestContext::parse_byte_range(std::string range) -{ - const std::string byteUnitSpec("bytes="); - if ( kiwix::startsWith(range, byteUnitSpec) ) { - range.erase(0, byteUnitSpec.size()); - int start = 0; - int end = -1; - std::istringstream iss(range); - char c; - - iss >> start >> c; - if (iss.good() && c=='-') { - iss >> end; - if (iss.fail()) { - // Something went wrong will extracting. - end = -1; - } - if (iss.eof()) { - accept_range = true; - range_pair = std::pair(start, end); - } - } - } -} - RequestContext::~RequestContext() {} +void RequestContext::parse_byte_range(std::string range) +{ + const std::string byteUnitSpec("bytes="); + if ( kiwix::startsWith(range, byteUnitSpec) ) { + range.erase(0, byteUnitSpec.size()); + int start = 0; + int end = -1; + std::istringstream iss(range); + char c; + + iss >> start >> c; + if (iss.good() && c=='-') { + iss >> end; + if (iss.fail()) { + // Something went wrong while extracting + end = -1; + } + if (iss.eof()) { + accept_range = true; + range_pair = std::pair(start, end); + } + } + } +} + int RequestContext::fill_header(void *__this, enum MHD_ValueKind kind, const char *key, const char *value)