mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-25 04:00:56 +00:00
Fix build warnings
This commit is contained in:
parent
e7e54ef28c
commit
9b33d5c808
2 changed files with 9 additions and 5 deletions
|
@ -634,7 +634,7 @@ static const char *GetPrintableFileSize(UINT64 filesize)
|
|||
if (filesize >= 1024*1024)
|
||||
snprintf(downloadsize, sizeof(downloadsize), "%.2fMiB", (double)filesize / (1024*1024));
|
||||
else if (filesize < 1024)
|
||||
snprintf(downloadsize, sizeof(downloadsize), "%luB", filesize);
|
||||
snprintf(downloadsize, sizeof(downloadsize), "%sB", sizeu1(filesize));
|
||||
else
|
||||
snprintf(downloadsize, sizeof(downloadsize), "%.2fKiB", (double)filesize / 1024);
|
||||
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
/// \file d_netfil.c
|
||||
/// \brief Transfer a file using HSendPacket.
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
@ -53,10 +57,6 @@
|
|||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_CURL
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
||||
// Prototypes
|
||||
static boolean AddFileToSendQueue(INT32 node, UINT8 fileid);
|
||||
|
||||
|
@ -1633,7 +1633,11 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
|
|||
curl_easy_setopt(http_handle, CURLOPT_URL, va("%s/%s?md5=%s", url, curl_realname, md5tmp));
|
||||
|
||||
// Only allow HTTP and HTTPS
|
||||
#if (LIBCURL_VERSION_MAJOR <= 7) && (LIBCURL_VERSION_MINOR < 85)
|
||||
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS);
|
||||
#else
|
||||
curl_easy_setopt(http_handle, CURLOPT_PROTOCOLS_STR, "http,https");
|
||||
#endif
|
||||
|
||||
// Set user agent, as some servers won't accept invalid user agents.
|
||||
curl_easy_setopt(http_handle, CURLOPT_USERAGENT, va("Sonic Robo Blast 2/v%d.%d", VERSION, SUBVERSION));
|
||||
|
|
Loading…
Reference in a new issue