Fix small bug in HttpConnection::read()

This commit is contained in:
Christophe Dumez 2011-10-01 22:10:13 +03:00
parent 9cf37f5364
commit 65eb40d1f5

View File

@ -83,6 +83,7 @@ void HttpConnection::read() {
input.append(m_socket->readAll());
if(input.size() > 100000) {
qDebug("Request too big");
input.clear();
m_generator.setStatusLine(400, "Bad Request");
write();
return;
@ -99,6 +100,7 @@ void HttpConnection::read() {
input.clear();
if(m_parser.isError()) {
qDebug() << Q_FUNC_INFO << "parsing error";
m_generator.setStatusLine(400, "Bad Request");
write();
} else {
@ -405,6 +407,7 @@ void HttpConnection::respondCommand(const QString& command) {
return;
}
if(command == "upload") {
qDebug() << Q_FUNC_INFO << "upload";
// Get a unique filename
// XXX: We need to use a QTemporaryFile pointer here
// and it fails on Windows.