mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +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("https://maps.ddnet.tw/", m_aUrl, 22) == 0
|
||||||
|| str_comp_nocase_num("http://info.ddnet.tw/", m_aUrl, 21) == 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://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);
|
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)
|
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;
|
return pBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,12 +244,14 @@ void CUpdater::ParseUpdate()
|
||||||
if(!File)
|
if(!File)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char aBuf[4096*4];
|
long int Length = io_length(File);
|
||||||
mem_zero(aBuf, sizeof (aBuf));
|
char *pBuf = (char *)malloc(Length);
|
||||||
io_read(File, aBuf, sizeof(aBuf));
|
mem_zero(pBuf, Length);
|
||||||
|
io_read(File, pBuf, Length);
|
||||||
io_close(File);
|
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)
|
if(pVersions && pVersions->type == json_array)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue