From 4f0c071e53ed1be17bd9bdd0079e585f0a1bf55c Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Fri, 29 Jul 2016 12:07:14 +0600 Subject: CLOUD: Add custom User-Agent Full version is used like in Eugene's Google Analytics stub. Plus, on PS3 that string contains "PlayStation", and that would be cool to know that ScummVM+libcurl+PS3 work together. --- backends/networking/curl/networkreadstream.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/networking') diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp index 9b20a758ee..30659e2361 100644 --- a/backends/networking/curl/networkreadstream.cpp +++ b/backends/networking/curl/networkreadstream.cpp @@ -24,6 +24,7 @@ #include "backends/networking/curl/networkreadstream.h" #include "backends/networking/curl/connectionmanager.h" +#include "base/version.h" #include "common/debug.h" #include @@ -79,6 +80,7 @@ void NetworkReadStream::init(const char *url, curl_slist *headersList, const byt curl_easy_setopt(_easy, CURLOPT_VERBOSE, 0L); curl_easy_setopt(_easy, CURLOPT_FOLLOWLOCATION, 1L); //probably it's OK to have it always on curl_easy_setopt(_easy, CURLOPT_HTTPHEADER, headersList); + curl_easy_setopt(_easy, CURLOPT_USERAGENT, gScummVMFullVersion); curl_easy_setopt(_easy, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(_easy, CURLOPT_PROGRESSFUNCTION, curlProgressCallbackOlder); curl_easy_setopt(_easy, CURLOPT_PROGRESSDATA, this); @@ -122,6 +124,7 @@ void NetworkReadStream::init(const char *url, curl_slist *headersList, Common::H curl_easy_setopt(_easy, CURLOPT_VERBOSE, 0L); curl_easy_setopt(_easy, CURLOPT_FOLLOWLOCATION, 1L); //probably it's OK to have it always on curl_easy_setopt(_easy, CURLOPT_HTTPHEADER, headersList); + curl_easy_setopt(_easy, CURLOPT_USERAGENT, gScummVMFullVersion); curl_easy_setopt(_easy, CURLOPT_NOPROGRESS, 0L); curl_easy_setopt(_easy, CURLOPT_PROGRESSFUNCTION, curlProgressCallbackOlder); curl_easy_setopt(_easy, CURLOPT_PROGRESSDATA, this); -- cgit v1.2.3