1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Don't call the lock/unlock functions if they are NULL. They can still be

NULL without violating protocol.
This commit is contained in:
Daniel Stenberg 2004-02-26 11:39:38 +00:00
parent 0943f33438
commit be2cdf14f3

View File

@ -186,7 +186,8 @@ Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
return CURLSHE_INVALID; return CURLSHE_INVALID;
if(share->specifier & (1<<type)) { if(share->specifier & (1<<type)) {
share->lockfunc(data, type, accesstype, share->clientdata); if(share->lockfunc) /* only call this if set! */
share->lockfunc(data, type, accesstype, share->clientdata);
} }
/* else if we don't share this, pretend successful lock */ /* else if we don't share this, pretend successful lock */
@ -202,7 +203,8 @@ Curl_share_unlock(struct SessionHandle *data, curl_lock_data type)
return CURLSHE_INVALID; return CURLSHE_INVALID;
if(share->specifier & (1<<type)) { if(share->specifier & (1<<type)) {
share->unlockfunc (data, type, share->clientdata); if(share->unlockfunc) /* only call this if set! */
share->unlockfunc (data, type, share->clientdata);
} }
return CURLSHE_OK; return CURLSHE_OK;