Fixed multithreading usage of HTTP chunked encoding.

This commit is contained in:
Thulinma 2013-08-22 15:19:25 +02:00
parent 5b38492c8b
commit f0b36a0e36

View file

@ -475,7 +475,7 @@ void HTTP::Parser::parseVars(std::string data){
/// \param bodypart The data to convert - will be converted in-place.
void HTTP::Parser::Chunkify(std::string & bodypart){
if (protocol == "HTTP/1.1"){
static char len[10];
char len[10];
int sizelen = snprintf(len, 10, "%x\r\n", (unsigned int)bodypart.size());
//prepend the chunk size and \r\n
bodypart.insert(0, len, sizelen);
@ -494,7 +494,7 @@ void HTTP::Parser::Chunkify(std::string & bodypart, Socket::Connection & conn){
/// \param bodypart The data to convert - will be converted in-place.
void HTTP::Parser::Chunkify(const char * data, unsigned int size, Socket::Connection & conn){
if (protocol == "HTTP/1.1"){
static char len[10];
char len[10];
int sizelen = snprintf(len, 10, "%x\r\n", size);
//prepend the chunk size and \r\n
conn.SendNow(len, sizelen);