mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Allow any update.json size
just grew over 16 KB and thus updates failed. I still need to setup update5 server and will need to release a last release on update4 to have a seemless upgrade-path.
This commit is contained in:
parent
905c9617c6
commit
cf77b567f8
|
@ -146,7 +146,7 @@ int CRequest::RunImpl(CURL *pHandle)
|
|||
|| str_comp_nocase_num("https://maps.ddnet.tw/", m_aUrl, 22) == 0
|
||||
|| str_comp_nocase_num("http://info.ddnet.tw/", m_aUrl, 21) == 0
|
||||
|| str_comp_nocase_num("https://info.ddnet.tw/", m_aUrl, 22) == 0
|
||||
|| str_comp_nocase_num("https://update4.ddnet.tw/", m_aUrl, 25) == 0)
|
||||
|| str_comp_nocase_num("https://update5.ddnet.tw/", m_aUrl, 25) == 0)
|
||||
{
|
||||
curl_easy_setopt(pHandle, CURLOPT_CAINFO, CA_FILE_PATH);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
static const char *GetUpdaterUrl(char *pBuf, int BufSize, const char *pFile)
|
||||
{
|
||||
str_format(pBuf, BufSize, "https://update4.ddnet.tw/%s", pFile);
|
||||
str_format(pBuf, BufSize, "https://update5.ddnet.tw/%s", pFile);
|
||||
return pBuf;
|
||||
}
|
||||
|
||||
|
@ -244,12 +244,14 @@ void CUpdater::ParseUpdate()
|
|||
if(!File)
|
||||
return;
|
||||
|
||||
char aBuf[4096*4];
|
||||
mem_zero(aBuf, sizeof (aBuf));
|
||||
io_read(File, aBuf, sizeof(aBuf));
|
||||
long int Length = io_length(File);
|
||||
char *pBuf = (char *)malloc(Length);
|
||||
mem_zero(pBuf, Length);
|
||||
io_read(File, pBuf, Length);
|
||||
io_close(File);
|
||||
|
||||
json_value *pVersions = json_parse(aBuf, sizeof(aBuf));
|
||||
json_value *pVersions = json_parse(pBuf, Length);
|
||||
free(pBuf);
|
||||
|
||||
if(pVersions && pVersions->type == json_array)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue