Skip to content

Instantly share code, notes, and snippets.

@kahrl

kahrl/gist:8045752

Created Dec 19, 2013
Embed
What would you like to do?
diff --git a/src/server.cpp b/src/server.cpp
index c1cedf0..53c7161 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2745,22 +2745,16 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
std::string datastring((char*)&data[2], datasize-2);
std::istringstream is(datastring, std::ios_base::binary);
- std::list<std::string> tosend;
u16 numfiles = readU16(is);
- infostream<<"Sending "<<numfiles<<" files to "
+ if(numfiles > 0) {
+ actionstream<<"Server: Denying request for "
+ <<numfiles<<" media files by "
<<getPlayerName(peer_id)<<std::endl;
- verbosestream<<"TOSERVER_REQUEST_MEDIA: "<<std::endl;
-
- for(int i = 0; i < numfiles; i++) {
- std::string name = deSerializeString(is);
- tosend.push_back(name);
- verbosestream<<"TOSERVER_REQUEST_MEDIA: requested file "
- <<name<<std::endl;
+ DenyAccess(peer_id, L"Please use a cURL-enabled build to access this server");
+ return;
}
- sendRequestedMedia(peer_id, tosend);
-
// Now the client should know about everything
// (definitions and files)
getClient(peer_id)->definitions_sent = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment