|
|
|
@ -84,7 +84,7 @@ void HttpRequestParser::writeMessage(const QByteArray& ba) {
@@ -84,7 +84,7 @@ void HttpRequestParser::writeMessage(const QByteArray& ba) {
|
|
|
|
|
Q_ASSERT (m_header.hasContentLength()); |
|
|
|
|
|
|
|
|
|
m_data = ba; |
|
|
|
|
qDebug() << "m_data.size(): " << m_data.size(); |
|
|
|
|
qDebug() << Q_FUNC_INFO << "m_data.size(): " << m_data.size(); |
|
|
|
|
|
|
|
|
|
// Parse POST data
|
|
|
|
|
if(m_header.contentType() == "application/x-www-form-urlencoded") { |
|
|
|
@ -95,8 +95,10 @@ void HttpRequestParser::writeMessage(const QByteArray& ba) {
@@ -95,8 +95,10 @@ void HttpRequestParser::writeMessage(const QByteArray& ba) {
|
|
|
|
|
QPair<QString, QString> pair = i.next(); |
|
|
|
|
m_postMap[pair.first] = pair.second; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// Parse form data (torrent file)
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Parse multipart/form data (torrent file)
|
|
|
|
|
/**
|
|
|
|
|
m_data has the following format (if boundary is "cH2ae0GI3KM7GI3Ij5ae0ei4Ij5Ij5") |
|
|
|
|
|
|
|
|
@ -116,6 +118,8 @@ Submit Query
@@ -116,6 +118,8 @@ Submit Query
|
|
|
|
|
--cH2ae0GI3KM7GI3Ij5ae0ei4Ij5Ij5-- |
|
|
|
|
**/ |
|
|
|
|
if (m_header.contentType().startsWith("multipart/form-data")) { |
|
|
|
|
qDebug() << Q_FUNC_INFO << "header is: " << m_header.toString(); |
|
|
|
|
|
|
|
|
|
int filename_index = m_data.indexOf("filename="); |
|
|
|
|
if (filename_index >= 0) { |
|
|
|
|
QByteArray boundary = m_data.left(m_data.indexOf("\r\n")); |
|
|
|
@ -133,4 +137,3 @@ Submit Query
@@ -133,4 +137,3 @@ Submit Query
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|