Fix downloads from insecure websites

This commit is contained in:
wiidev 2019-10-29 03:11:56 +00:00
parent 7e4011138f
commit 314d197afb

View File

@ -29,7 +29,7 @@ int https_write(HTTP_INFO *httpinfo, char *buffer, int len)
if (ret == 0)
continue;
else if (ret <= 0)
return ret; // timeout would return -1
return ret; // Timeout would return -1
slen += ret;
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)
{
if (len > 8192)
len = 8192; // 16KB is the max on a Wii, but 8KB is safe
if (httpinfo->use_https)
return wolfSSL_read(httpinfo->ssl, buffer, len);
return net_read(httpinfo->sock, buffer, len);
}