Browse files

Fix for issues with callback userData

MultipartReader always passes an uninitialized pointer as the userData argument for all callbacks, and a MultipartReader instance's userData cannot be set externally.
Modified MultipartReader to initialize and expose the userData property as in MultipartParser.
  • Loading branch information...
1 parent 374f11e commit 691f37ed326a2b8c160376617b399892fc83a4d2 @johnyanarella johnyanarella committed May 13, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 MultipartReader.h
View
3 MultipartReader.h
@@ -30,13 +30,13 @@ class MultipartReader {
bool headersProcessed;
MultipartHeaders currentHeaders;
std::string currentHeaderName, currentHeaderValue;
- void *userData;
void resetReaderCallbacks() {
onPartBegin = NULL;
onPartData = NULL;
onPartEnd = NULL;
onEnd = NULL;
+ userData = NULL;
}
void setParserCallbacks() {
@@ -113,6 +113,7 @@ class MultipartReader {
PartDataCallback onPartData;
Callback onPartEnd;
Callback onEnd;
+ void *userData;
MultipartReader() {
resetReaderCallbacks();

0 comments on commit 691f37e

Please sign in to comment.