mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-01 00:55:06 +01:00
Merge pull request #129 from wiidev/master
Fix downloads from insecure websites
This commit is contained in:
commit
59a9c59a19
@ -29,7 +29,7 @@ int https_write(HTTP_INFO *httpinfo, char *buffer, int len)
|
|||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
continue;
|
continue;
|
||||||
else if (ret <= 0)
|
else if (ret <= 0)
|
||||||
return ret; // timeout would return -1
|
return ret; // Timeout would return -1
|
||||||
|
|
||||||
slen += ret;
|
slen += ret;
|
||||||
if (slen >= len)
|
if (slen >= len)
|
||||||
@ -40,9 +40,10 @@ int https_write(HTTP_INFO *httpinfo, char *buffer, int len)
|
|||||||
|
|
||||||
int https_read(HTTP_INFO *httpinfo, char *buffer, int len)
|
int https_read(HTTP_INFO *httpinfo, char *buffer, int len)
|
||||||
{
|
{
|
||||||
|
if (len > 8192)
|
||||||
|
len = 8192; // 16KB is the max on a Wii, but 8KB is safe
|
||||||
if (httpinfo->use_https)
|
if (httpinfo->use_https)
|
||||||
return wolfSSL_read(httpinfo->ssl, buffer, len);
|
return wolfSSL_read(httpinfo->ssl, buffer, len);
|
||||||
|
|
||||||
return net_read(httpinfo->sock, buffer, len);
|
return net_read(httpinfo->sock, buffer, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user