mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Web server: Send 404 as appropriate
This commit is contained in:
1 parent
c97d5ef23f
commit
2160abb5ec
2 files changed
+8
No files matched your search
@@ -178,6 +178,7 @@ bool Connection::Connect(int maxTries, double timeout, bool *cancelConnect) {
|
||||
|
||||
selectResult = select(maxfd, nullptr, &fds, nullptr, &tv);
|
||||
if (cancelConnect && *cancelConnect) {
|
||||
WARN_LOG(HTTP, "connect(%d): cancelled (1)", sock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -196,6 +197,7 @@ bool Connection::Connect(int maxTries, double timeout, bool *cancelConnect) {
|
||||
}
|
||||
|
||||
if (cancelConnect && *cancelConnect) {
|
||||
WARN_LOG(HTTP, "connect(%d): cancelled (2)", sock);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,6 +162,12 @@ static Path LocalFromRemotePath(const std::string &path) {
|
||||
|
||||
static void DiscHandler(const http::ServerRequest &request, const Path &filename) {
|
||||
s64 sz = File::GetFileSize(filename);
|
||||
if (sz == 0) {
|
||||
// Probably failed
|
||||
request.WriteHttpResponseHeader("1.0", 404, -1, "text/plain");
|
||||
request.Out()->Push("File not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string range;
|
||||
if (request.Method() == http::RequestHeader::HEAD) {
|
||||
|
||||
Reference in new issue
Block a user