httprequest.cpp   httprequest.cpp 
skipping to change at line 441 skipping to change at line 441
} }
else if (line.isEmpty()) else if (line.isEmpty())
{ {
break; break;
} }
} }
#ifdef SUPERVERBOSE #ifdef SUPERVERBOSE
qDebug("HttpRequest: reading multpart data"); qDebug("HttpRequest: reading multpart data");
#endif #endif
QTemporaryFile* uploadedFile=0; QTemporaryFile* uploadedFile=Q_NULLPTR;
QByteArray fieldValue; QByteArray fieldValue;
while (!tempFile.atEnd() && !finished && !tempFile.error()) while (!tempFile.atEnd() && !finished && !tempFile.error())
{ {
QByteArray line=tempFile.readLine(65536); QByteArray line=tempFile.readLine(65536);
if (line.startsWith("--"+boundary)) if (line.startsWith("--"+boundary))
{ {
// Boundary found. Until now we have collect ed 2 bytes too much, // Boundary found. Until now we have collect ed 2 bytes too much,
// so remove them from the last result // so remove them from the last result
if (fileName.isEmpty() && !fieldName.isEmpty ()) if (fileName.isEmpty() && !fieldName.isEmpty ())
{ {
skipping to change at line 463 skipping to change at line 463
fieldValue.remove(fieldValue.size()- 2,2); fieldValue.remove(fieldValue.size()- 2,2);
parameters.insert(fieldName,fieldVal ue); parameters.insert(fieldName,fieldVal ue);
qDebug("HttpRequest: set parameter % s=%s",fieldName.data(),fieldValue.data()); qDebug("HttpRequest: set parameter % s=%s",fieldName.data(),fieldValue.data());
} }
else if (!fileName.isEmpty() && !fieldName.i sEmpty()) else if (!fileName.isEmpty() && !fieldName.i sEmpty())
{ {
// last field was a file // last field was a file
#ifdef SUPERVERBOSE #ifdef SUPERVERBOSE
qDebug("HttpRequest: finishing writi ng to uploaded file"); qDebug("HttpRequest: finishing writi ng to uploaded file");
#endif #endif
Q_ASSERT(uploadedFile);
uploadedFile->resize(uploadedFile->s ize()-2); uploadedFile->resize(uploadedFile->s ize()-2);
uploadedFile->flush(); uploadedFile->flush();
uploadedFile->seek(0); uploadedFile->seek(0);
parameters.insert(fieldName,fileName ); parameters.insert(fieldName,fileName );
qDebug("HttpRequest: set parameter % s=%s",fieldName.data(),fileName.data()); qDebug("HttpRequest: set parameter % s=%s",fieldName.data(),fileName.data());
uploadedFiles.insert(fieldName,uploa dedFile); uploadedFiles.insert(fieldName,uploa dedFile);
qDebug("HttpRequest: uploaded file s ize is %i",(int) uploadedFile->size()); qDebug("HttpRequest: uploaded file s ize is %i",(int) uploadedFile->size());
} }
if (line.contains(boundary+"--")) if (line.contains(boundary+"--"))
{ {
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/