Esempio n. 1
0
/*
=================
CL_cURL_Init
=================
*/
qboolean CL_cURL_Init()
{
	if(cURLLib)
		return qtrue;

	Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
	if( (cURLLib = OBJLOAD(cl_cURLLib->string)) == 0 )
	{
#ifdef _WIN32
		return qfalse;
#else
		char fn[1024];
		getcwd(fn, sizeof(fn));
		strncat(fn, "/", sizeof(fn));
		strncat(fn, cl_cURLLib->string, sizeof(fn));

		if( (cURLLib = OBJLOAD(fn)) == 0 )
		{
			return qfalse;
		}
#endif
	}

	clc.cURLEnabled = qtrue;

	qcurl_version = GPA("curl_version");

	qcurl_easy_init = GPA("curl_easy_init");
	qcurl_easy_setopt = GPA("curl_easy_setopt");
	qcurl_easy_perform = GPA("curl_easy_perform");
	qcurl_easy_cleanup = GPA("curl_easy_cleanup");
	qcurl_easy_getinfo = GPA("curl_easy_getinfo");
	qcurl_easy_duphandle = GPA("curl_easy_duphandle");
	qcurl_easy_reset = GPA("curl_easy_reset");
	qcurl_easy_strerror = GPA("curl_easy_strerror");
	
	qcurl_multi_init = GPA("curl_multi_init");
	qcurl_multi_add_handle = GPA("curl_multi_add_handle");
	qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
	qcurl_multi_fdset = GPA("curl_multi_fdset");
	qcurl_multi_perform = GPA("curl_multi_perform");
	qcurl_multi_cleanup = GPA("curl_multi_cleanup");
	qcurl_multi_info_read = GPA("curl_multi_info_read");
	qcurl_multi_strerror = GPA("curl_multi_strerror");

	if(!clc.cURLEnabled)
	{
		CL_cURL_Shutdown();
		Com_Printf("FAIL One or more symbols not found\n");
		return qfalse;
	}
	Com_Printf("OK\n");

	return qtrue;
}
Esempio n. 2
0
/*
=================
CL_cURL_Init
=================
*/
qboolean CL_cURL_Init()
{
#ifdef USE_CURL_DLOPEN
	if(cURLLib)
		return qtrue;


	Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
	if(!(cURLLib = Sys_LoadDll(cl_cURLLib->string, qtrue)))
	{
#ifdef ALTERNATE_CURL_LIB
		// On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too.
		if(!(cURLLib = Sys_LoadDll(ALTERNATE_CURL_LIB, qtrue)))
#endif
			return qfalse;
	}

	clc.cURLEnabled = qtrue;

	qcurl_version = GPA("curl_version");

	qcurl_easy_init = GPA("curl_easy_init");
	qcurl_easy_setopt = GPA("curl_easy_setopt");
	qcurl_easy_perform = GPA("curl_easy_perform");
	qcurl_easy_cleanup = GPA("curl_easy_cleanup");
	qcurl_easy_getinfo = GPA("curl_easy_getinfo");
	qcurl_easy_duphandle = GPA("curl_easy_duphandle");
	qcurl_easy_reset = GPA("curl_easy_reset");
	qcurl_easy_strerror = GPA("curl_easy_strerror");
	
	qcurl_multi_init = GPA("curl_multi_init");
	qcurl_multi_add_handle = GPA("curl_multi_add_handle");
	qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
	qcurl_multi_fdset = GPA("curl_multi_fdset");
	qcurl_multi_perform = GPA("curl_multi_perform");
	qcurl_multi_cleanup = GPA("curl_multi_cleanup");
	qcurl_multi_info_read = GPA("curl_multi_info_read");
	qcurl_multi_strerror = GPA("curl_multi_strerror");

	if(!clc.cURLEnabled)
	{
		CL_cURL_Shutdown();
		Com_Printf("FAIL One or more symbols not found\n");
		return qfalse;
	}
	Com_Printf("OK\n");

	return qtrue;
#else
	clc.cURLEnabled = qtrue;
	return qtrue;
#endif /* USE_CURL_DLOPEN */
}
Esempio n. 3
0
/*
=================
CL_cURL_Init
=================
*/
qboolean CL_cURL_Init()
{
#ifdef USE_CURL_DLOPEN
    if(cURLLib)
        return qtrue;


    Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
    if( (cURLLib = Sys_LoadLibrary(cl_cURLLib->string)) == 0 )
    {
#ifdef _WIN32
        return qfalse;
#else
        char fn[1024];

        Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
        strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
        strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);

        if((cURLLib = Sys_LoadLibrary(fn)) == 0)
        {
#ifdef ALTERNATE_CURL_LIB
            // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too.
            if( (cURLLib = Sys_LoadLibrary(ALTERNATE_CURL_LIB)) == 0 )
            {
                return qfalse;
            }
#else
            return qfalse;
#endif
        }
#endif /* _WIN32 */
    }

    clc.cURLEnabled = qtrue;

    qcurl_version = GPA("curl_version");

    qcurl_easy_init = GPA("curl_easy_init");
    qcurl_easy_setopt = GPA("curl_easy_setopt");
    qcurl_easy_perform = GPA("curl_easy_perform");
    qcurl_easy_cleanup = GPA("curl_easy_cleanup");
    qcurl_easy_getinfo = GPA("curl_easy_getinfo");
    qcurl_easy_duphandle = GPA("curl_easy_duphandle");
    qcurl_easy_reset = GPA("curl_easy_reset");
    qcurl_easy_strerror = GPA("curl_easy_strerror");

    qcurl_multi_init = GPA("curl_multi_init");
    qcurl_multi_add_handle = GPA("curl_multi_add_handle");
    qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
    qcurl_multi_fdset = GPA("curl_multi_fdset");
    qcurl_multi_perform = GPA("curl_multi_perform");
    qcurl_multi_cleanup = GPA("curl_multi_cleanup");
    qcurl_multi_info_read = GPA("curl_multi_info_read");
    qcurl_multi_strerror = GPA("curl_multi_strerror");

    if(!clc.cURLEnabled)
    {
        CL_cURL_Shutdown();
        Com_Printf("FAIL One or more symbols not found\n");
        return qfalse;
    }
    Com_Printf("OK\n");

    return qtrue;
#else
    clc.cURLEnabled = qtrue;
    return qtrue;
#endif /* USE_CURL_DLOPEN */
}