fixes issue #804

This commit is contained in:
Dennis Luxen 2013-11-20 18:24:06 +01:00
parent 7de27df309
commit 0e43697ee0
4 changed files with 20 additions and 5 deletions

View File

@ -106,7 +106,11 @@ public:
reply.headers[2].value = "attachment; filename=\"location.json\""; reply.headers[2].value = "attachment; filename=\"location.json\"";
} }
reply.headers[0].name = "Content-Length"; reply.headers[0].name = "Content-Length";
intToString(reply.content.size(), tmp); unsigned content_length = 0;
BOOST_FOREACH(const std::string & snippet, reply.content) {
content_length += snippet.length();
}
intToString(content_length, tmp);
reply.headers[0].value = tmp; reply.headers[0].value = tmp;
return; return;
} }

View File

@ -115,7 +115,11 @@ public:
reply.headers[2].value = "attachment; filename=\"location.json\""; reply.headers[2].value = "attachment; filename=\"location.json\"";
} }
reply.headers[0].name = "Content-Length"; reply.headers[0].name = "Content-Length";
intToString(reply.content.size(), temp_string); unsigned content_length = 0;
BOOST_FOREACH(const std::string & snippet, reply.content) {
content_length += snippet.length();
}
intToString(content_length, temp_string);
reply.headers[0].value = temp_string; reply.headers[0].value = temp_string;
} }

View File

@ -69,8 +69,11 @@ public:
reply.headers[2].name = "Content-Disposition"; reply.headers[2].name = "Content-Disposition";
reply.headers[2].value = "attachment; filename=\"timestamp.json\""; reply.headers[2].value = "attachment; filename=\"timestamp.json\"";
} }
reply.headers[0].name = "Content-Length"; unsigned content_length = 0;
intToString(reply.content.size(), tmp); BOOST_FOREACH(const std::string & snippet, reply.content) {
content_length += snippet.length();
}
intToString(content_length, tmp);
reply.headers[0].value = tmp; reply.headers[0].value = tmp;
} }
private: private:

View File

@ -182,7 +182,11 @@ public:
reply.headers.resize(3); reply.headers.resize(3);
reply.headers[0].name = "Content-Length"; reply.headers[0].name = "Content-Length";
std::string tmp; std::string tmp;
intToString(reply.content.size(), tmp); unsigned content_length = 0;
BOOST_FOREACH(const std::string & snippet, reply.content) {
content_length += snippet.length();
}
intToString(content_length, tmp);
reply.headers[0].value = tmp; reply.headers[0].value = tmp;
switch(descriptorType){ switch(descriptorType){
case 0: case 0: