Skip to content

Commit cf224c9

Browse files
sofarnerzhul
authored andcommitted
Remove remote media compatibility mode. (#8044)
The fallback code shouldn't be needed and is a remnant of the GET method that old media servers use. Clients using it are likely to just waste bandwidth and having to download the media again through the normal transfer from server method. The most reliable method is to get all missing textures therefore from the server directly and not spam the remote media server with 404s.
1 parent bba4563 commit cf224c9

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/client/clientmedia.cpp

+1-25
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ void ClientMediaDownloader::addRemoteServer(const std::string &baseurl)
105105
RemoteServerStatus *remote = new RemoteServerStatus();
106106
remote->baseurl = baseurl;
107107
remote->active_count = 0;
108-
remote->request_by_filename = false;
109108
m_remotes.push_back(remote);
110109
}
111110

@@ -299,28 +298,6 @@ void ClientMediaDownloader::remoteHashSetReceived(
299298
<< e.what() << std::endl;
300299
}
301300
}
302-
303-
// For compatibility: If index.mth is not found, assume that the
304-
// server contains files named like the original files (not their sha1)
305-
306-
// Do NOT check for any particular response code (e.g. 404) here,
307-
// because different servers respond differently
308-
309-
if (!fetch_result.succeeded && !fetch_result.timeout) {
310-
infostream << "Client: Enabling compatibility mode for remote "
311-
<< "server \"" << remote->baseurl << "\"" << std::endl;
312-
remote->request_by_filename = true;
313-
314-
// Assume every file is available on this server
315-
316-
for(std::map<std::string, FileStatus*>::iterator
317-
it = m_files.upper_bound(m_name_bound);
318-
it != m_files.end(); ++it) {
319-
FileStatus *f = it->second;
320-
if (!f->received)
321-
f->available_remotes.push_back(remote_id);
322-
}
323-
}
324301
}
325302

326303
void ClientMediaDownloader::remoteMediaReceived(
@@ -425,8 +402,7 @@ void ClientMediaDownloader::startRemoteMediaTransfers()
425402
m_remotes[remote_id];
426403

427404
std::string url = remote->baseurl +
428-
(remote->request_by_filename ? name :
429-
hex_encode(filestatus->sha1));
405+
hex_encode(filestatus->sha1);
430406
verbosestream << "Client: "
431407
<< "Requesting remote media file "
432408
<< "\"" << name << "\" "

src/client/clientmedia.h

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class ClientMediaDownloader
9292
struct RemoteServerStatus {
9393
std::string baseurl;
9494
s32 active_count;
95-
bool request_by_filename;
9695
};
9796

9897
void initialStep(Client *client);

0 commit comments

Comments
 (0)