mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
fix content length for 'do you want to download' overlay
This commit is contained in:
parent
76a0dcf548
commit
42db827998
@ -149,6 +149,7 @@ static void Http_SysMakeHeaders(String* headers, struct HttpRequest* req) {
|
|||||||
/* Creates and sends a http req */
|
/* Creates and sends a http req */
|
||||||
static ReturnCode Http_SysMakeRequest(struct HttpRequest* req, HINTERNET* handle) {
|
static ReturnCode Http_SysMakeRequest(struct HttpRequest* req, HINTERNET* handle) {
|
||||||
struct HttpCacheEntry entry;
|
struct HttpCacheEntry entry;
|
||||||
|
const char* verb;
|
||||||
DWORD flags;
|
DWORD flags;
|
||||||
String headers; char headersBuffer[STRING_SIZE * 3];
|
String headers; char headersBuffer[STRING_SIZE * 3];
|
||||||
String path; char pathBuffer[URL_MAX_SIZE + 1];
|
String path; char pathBuffer[URL_MAX_SIZE + 1];
|
||||||
@ -166,7 +167,9 @@ static ReturnCode Http_SysMakeRequest(struct HttpRequest* req, HINTERNET* handle
|
|||||||
flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_NO_UI | INTERNET_FLAG_RELOAD;
|
flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_NO_UI | INTERNET_FLAG_RELOAD;
|
||||||
if (entry.Https) flags |= INTERNET_FLAG_SECURE;
|
if (entry.Https) flags |= INTERNET_FLAG_SECURE;
|
||||||
|
|
||||||
*handle = HttpOpenRequestA(entry.Handle, "GET", pathBuffer, NULL, NULL, NULL, flags, 0);
|
verb = req->RequestType == REQUEST_TYPE_GET ? "GET" : "HEAD";
|
||||||
|
*handle = HttpOpenRequestA(entry.Handle, verb, pathBuffer, NULL, NULL, NULL, flags, 0);
|
||||||
|
|
||||||
return *handle && HttpSendRequestA(*handle, headers.buffer, headers.length, NULL, 0)
|
return *handle && HttpSendRequestA(*handle, headers.buffer, headers.length, NULL, 0)
|
||||||
? 0 : GetLastError();
|
? 0 : GetLastError();
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ enum HttpProgress {
|
|||||||
|
|
||||||
struct HttpRequest {
|
struct HttpRequest {
|
||||||
char URL[URL_MAX_SIZE]; /* URL data is downloaded from/uploaded to. */
|
char URL[URL_MAX_SIZE]; /* URL data is downloaded from/uploaded to. */
|
||||||
char ID[STRING_SIZE]; /* Unique identifier for this request. */
|
char ID[URL_MAX_SIZE]; /* Unique identifier for this request. */
|
||||||
TimeMS TimeAdded; /* Time this request was added to queue of requests. */
|
TimeMS TimeAdded; /* Time this request was added to queue of requests. */
|
||||||
TimeMS TimeDownloaded; /* Time response contents were completely downloaded. */
|
TimeMS TimeDownloaded; /* Time response contents were completely downloaded. */
|
||||||
int StatusCode; /* HTTP status code returned in the response. */
|
int StatusCode; /* HTTP status code returned in the response. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user