mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 01:44:26 +00:00
BUGFIX: Fix torrent upload issues (Web UI)
This commit is contained in:
parent
1ad1498c5d
commit
9cf37f5364
@ -9,6 +9,7 @@
|
||||
- BUGFIX: Reduce CPU usage when running Web UI
|
||||
- BUGFIX: Save RSS items to disk regularly for safety
|
||||
- BUGFIX: Fix ratio calculation (use all_time_download)
|
||||
- BUGFIX: Fix torrent upload issues (Web UI)
|
||||
- COSMETIC: Display speed at the beginning of the Window title
|
||||
- COSMETIC: Several cosmetic fixes to the Web UI
|
||||
- COSMETIC: Make top toolbar follow system style
|
||||
|
@ -78,19 +78,31 @@ void HttpConnection::handleDownloadFailure(const QString& url,
|
||||
}
|
||||
|
||||
void HttpConnection::read() {
|
||||
const QByteArray input = m_socket->readAll();
|
||||
static QByteArray input;
|
||||
|
||||
input.append(m_socket->readAll());
|
||||
if(input.size() > 100000) {
|
||||
qDebug("Request too big");
|
||||
m_generator.setStatusLine(400, "Bad Request");
|
||||
write();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!input.endsWith("\r\n\r\n")) {
|
||||
// incomplete, let wait for more data
|
||||
qDebug() << Q_FUNC_INFO << "Incomplete HTTP request, let's wait for more data...";
|
||||
return;
|
||||
}
|
||||
|
||||
// HTTP Request is complete, let's parse it
|
||||
m_parser.write(input);
|
||||
input.clear();
|
||||
|
||||
if(m_parser.isError()) {
|
||||
m_generator.setStatusLine(400, "Bad Request");
|
||||
write();
|
||||
} else {
|
||||
respond();
|
||||
respond();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user