Fix truncated files served from internal HTTP server.

BUG: 368
This commit is contained in:
craig.p.drummond
2013-12-30 10:29:05 +00:00
committed by craig.p.drummond
parent bc67f706f9
commit 95e78ad24b
2 changed files with 3 additions and 1 deletions

View File

@@ -340,6 +340,7 @@ void HttpSocket::readClient()
qint32 readBytesTo=0;
getRange(params, readBytesFrom, readBytesTo);
DBUG << "readBytesFrom" << readBytesFrom << "readBytesTo" << readBytesTo;
if (q.hasQueryItem("cantata")) {
Song song=HttpServer::self()->decodeUrl(url);
@@ -446,7 +447,7 @@ void HttpSocket::readClient()
if (!write(socket, buffer, bytesRead, stop) || f.atEnd()) {
break;
}
} while ((readPos+bytesRead)<totalBytes && !stop && !terminated);
} while (readPos<totalBytes && !stop && !terminated);
}
}
}