diff --git a/source/pkgi.c b/source/pkgi.c index c84f4c7..1106295 100644 --- a/source/pkgi.c +++ b/source/pkgi.c @@ -700,9 +700,9 @@ static void pkgi_load_language(const char* lang) mini18n_set_locale(path); } -static int pkgi_security_check() +static int pkgi_security_check(void) { - return 0; + return 1; } int main(int argc, const char* argv[]) diff --git a/source/pkgi_ps3.c b/source/pkgi_ps3.c index d0ac3ae..3634137 100644 --- a/source/pkgi_ps3.c +++ b/source/pkgi_ps3.c @@ -44,6 +44,9 @@ #define PKGI_USER_AGENT "Mozilla/5.0 (PLAYSTATION 3; 1.00)" +#define PKGI_CURL_BUFFER_SIZE (256 * 1024L) +#define PKGI_FILE_BUFFER_SIZE (256 * 1024) + struct pkgi_http { @@ -1154,6 +1157,10 @@ void pkgi_curl_init(CURL *curl) // request using SSL for the FTP transfer if available curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY); + curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, PKGI_CURL_BUFFER_SIZE); + curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); + curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 30L); + // check for proxy settings memset(&proxy_info, 0, sizeof(proxy_info)); netCtlGetInfo(NET_CTL_INFO_HTTP_PROXY_CONFIG, &proxy_info); @@ -1367,6 +1374,7 @@ void* pkgi_create(const char* path) LOG("cannot create %s, err=0x%08x", path, fd); return NULL; } + setvbuf(fd, NULL, _IOFBF, PKGI_FILE_BUFFER_SIZE); LOG("fopen returned fd=%d", fd); return (void*)fd; @@ -1395,6 +1403,7 @@ void* pkgi_append(const char* path) LOG("cannot append %s, err=0x%08x", path, fd); return NULL; } + setvbuf(fd, NULL, _IOFBF, PKGI_FILE_BUFFER_SIZE); LOG("fopen returned fd=%d", fd); return (void*)fd;