mirror of
https://github.com/moparisthebest/curl
synced 2025-03-01 01:41:50 -05:00
Fix compiler warning "enumerated type mixed with another type"
This commit is contained in:
parent
f3c508f6e8
commit
773bec5ae5
@ -130,7 +130,7 @@ char *suburl(char *base, int i)
|
|||||||
int test(char *URL)
|
int test(char *URL)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
CURLSHcode scode;
|
CURLSHcode scode = CURLSHE_OK;
|
||||||
char *url;
|
char *url;
|
||||||
struct Tdata tdata;
|
struct Tdata tdata;
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
@ -148,15 +148,29 @@ int test(char *URL)
|
|||||||
/* prepare share */
|
/* prepare share */
|
||||||
printf( "SHARE_INIT\n" );
|
printf( "SHARE_INIT\n" );
|
||||||
share = curl_share_init();
|
share = curl_share_init();
|
||||||
scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, lock);
|
|
||||||
scode += curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, unlock);
|
|
||||||
scode += curl_share_setopt( share, CURLSHOPT_USERDATA, &user);
|
|
||||||
printf( "CURL_LOCK_DATA_COOKIE\n" );
|
|
||||||
scode += curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
|
|
||||||
printf( "CURL_LOCK_DATA_DNS\n" );
|
|
||||||
scode += curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
|
|
||||||
|
|
||||||
if(scode) {
|
if ( CURLSHE_OK == scode ) {
|
||||||
|
printf( "CURLSHOPT_LOCKFUNC\n" );
|
||||||
|
scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, lock);
|
||||||
|
}
|
||||||
|
if ( CURLSHE_OK == scode ) {
|
||||||
|
printf( "CURLSHOPT_UNLOCKFUNC\n" );
|
||||||
|
scode = curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, unlock);
|
||||||
|
}
|
||||||
|
if ( CURLSHE_OK == scode ) {
|
||||||
|
printf( "CURLSHOPT_USERDATA\n" );
|
||||||
|
scode = curl_share_setopt( share, CURLSHOPT_USERDATA, &user);
|
||||||
|
}
|
||||||
|
if ( CURLSHE_OK == scode ) {
|
||||||
|
printf( "CURL_LOCK_DATA_COOKIE\n" );
|
||||||
|
scode = curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
|
||||||
|
}
|
||||||
|
if ( CURLSHE_OK == scode ) {
|
||||||
|
printf( "CURL_LOCK_DATA_DNS\n" );
|
||||||
|
scode = curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( CURLSHE_OK != scode ) {
|
||||||
curl_share_cleanup(share);
|
curl_share_cleanup(share);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user