Fix thread safety issue in chunked http transfers.

* The use of a static variable for storing the chunk size made it shared between all instances of BUrlProtoclHttp.
* Inline the function at the single place where it is used, and allocate the variable on the stack instead.

The whole receiving loop should be split into chunked and non-chunked variants to improve code readability.
This commit is contained in:
Adrien Destugues
2013-08-27 20:36:29 +02:00
parent 7032e70330
commit 2ec188b903
2 changed files with 44 additions and 55 deletions
-3
View File
@@ -54,9 +54,6 @@ private:
void _ParseStatus();
void _ParseHeaders();
void _CopyChunkInBuffer(char** buffer,
ssize_t* bytesReceived);
void _AddOutputBufferLine(const char* line);