Skip to content
Permalink
Browse files

Don't forget to check return code of HttpCache_Lookup

  • Loading branch information
UnknownShadow200 committed Dec 26, 2019
1 parent 5fb2656 commit a3a4eb23dbcc7ec1e8aa701a083f43983a6e59f6
Showing with 4 additions and 3 deletions.
  1. +3 −2 src/Http.c
  2. +1 −1 src/Http.h
@@ -351,7 +351,7 @@ static void Http_DownloadNextAsync(void) {
struct HttpRequest req;
if (http_terminate || !pendingReqs.count) return;
/* already working on a request currently */
if (http_curRequest.ID[0] != '\0') return;
if (http_curRequest.id[0]) return;

req = pendingReqs.entries[0];
RequestList_RemoveAt(&pendingReqs, 0);
@@ -560,12 +560,13 @@ static cc_result Http_StartRequest(struct HttpRequest* req, String* url, HINTERN
static const char* verbs[3] = { "GET", "HEAD", "POST" };
struct HttpCacheEntry entry;
String path; char pathBuffer[URL_MAX_SIZE + 1];
cc_result res;
DWORD flags;

HttpCache_MakeEntry(url, &entry, &path);
Mem_Copy(pathBuffer, path.buffer, path.length);
pathBuffer[path.length] = '\0';
HttpCache_Lookup(&entry);
if ((res = HttpCache_Lookup(&entry))) return res;

flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_NO_UI | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_COOKIES;
if (entry.Https) flags |= INTERNET_FLAG_SECURE;
@@ -29,7 +29,7 @@ struct HttpRequest {

cc_result result; /* 0 on success, otherwise platform-specific error. */
cc_uint8* data; /* Contents of the response. (i.e. result data) */
cc_uint32 size; /* Size of the contents. (may still be non-zero for non 200 status codes) */
cc_uint32 size; /* Size of the contents. */

char lastModified[STRING_SIZE]; /* Time item cached at (if at all) */
char etag[STRING_SIZE]; /* ETag of cached item (if any) */

0 comments on commit a3a4eb2

Please sign in to comment.
You can’t perform that action at this time.