mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
schannel: reorder functions topologically
The _shutdown() function calls the _session_free() function; While this is not a problem now (because schannel.h declares both functions), a patch looming in the immediate future with make all of these functions file-local. So let's just move the _session_free() function's definition before it is called. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
3ea5461d4e
commit
742ddc9d8f
@ -1435,6 +1435,18 @@ void Curl_schannel_close(struct connectdata *conn, int sockindex)
|
|||||||
Curl_ssl_shutdown(conn, sockindex);
|
Curl_ssl_shutdown(conn, sockindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Curl_schannel_session_free(void *ptr)
|
||||||
|
{
|
||||||
|
/* this is expected to be called under sessionid lock */
|
||||||
|
struct curl_schannel_cred *cred = ptr;
|
||||||
|
|
||||||
|
cred->refcount--;
|
||||||
|
if(cred->refcount == 0) {
|
||||||
|
s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
|
||||||
|
Curl_safefree(cred);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
|
int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
|
||||||
{
|
{
|
||||||
/* See https://msdn.microsoft.com/en-us/library/windows/desktop/aa380138.aspx
|
/* See https://msdn.microsoft.com/en-us/library/windows/desktop/aa380138.aspx
|
||||||
@ -1539,18 +1551,6 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Curl_schannel_session_free(void *ptr)
|
|
||||||
{
|
|
||||||
/* this is expected to be called under sessionid lock */
|
|
||||||
struct curl_schannel_cred *cred = ptr;
|
|
||||||
|
|
||||||
cred->refcount--;
|
|
||||||
if(cred->refcount == 0) {
|
|
||||||
s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
|
|
||||||
Curl_safefree(cred);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int Curl_schannel_init(void)
|
int Curl_schannel_init(void)
|
||||||
{
|
{
|
||||||
return (Curl_sspi_global_init() == CURLE_OK ? 1 : 0);
|
return (Curl_sspi_global_init() == CURLE_OK ? 1 : 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user