From cae2161d770f5cdb222c3b86f844e34950bf2f43 Mon Sep 17 00:00:00 2001 From: MikeLund Date: Wed, 5 Apr 2017 12:35:14 +0200 Subject: [PATCH] Serve favicon --- Tracker/connection.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tracker/connection.cpp b/Tracker/connection.cpp index 6ba42639..2f29226a 100644 --- a/Tracker/connection.cpp +++ b/Tracker/connection.cpp @@ -191,6 +191,16 @@ void Cconnection::read(const std::string& v) s = srv_scrape(ti, find_user_by_torrent_pass(torrent_pass, ti.m_info_hash)); } break; + case 'f': + if (v.size() >= 7) + { + std::ifstream fin("favicon.ico", std::ios::in | std::ios::binary); + std::ostringstream oss; + oss << fin.rdbuf(); + h += "Content-Type: image/png\r\n"; + s = oss.str(); + } + break; } if (s.empty()) {