mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Updated docs, test, and example to use correct digest auth API
This commit is contained in:
@@ -3332,7 +3332,7 @@ ahc_echo (void *cls,
|
|||||||
password,
|
password,
|
||||||
300,
|
300,
|
||||||
MHD_DIGEST_ALG_SHA256);
|
MHD_DIGEST_ALG_SHA256);
|
||||||
free(username);
|
MHD_free(username);
|
||||||
if ( (ret == MHD_INVALID_NONCE) ||
|
if ( (ret == MHD_INVALID_NONCE) ||
|
||||||
(ret == MHD_NO) )
|
(ret == MHD_NO) )
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -70,10 +70,11 @@ ahc_echo (void *cls,
|
|||||||
response = MHD_create_response_from_buffer (strlen (DENIED),
|
response = MHD_create_response_from_buffer (strlen (DENIED),
|
||||||
DENIED,
|
DENIED,
|
||||||
MHD_RESPMEM_PERSISTENT);
|
MHD_RESPMEM_PERSISTENT);
|
||||||
ret = MHD_queue_auth_fail_response (connection, realm,
|
ret = MHD_queue_auth_fail_response2 (connection, realm,
|
||||||
MY_OPAQUE_STR,
|
MY_OPAQUE_STR,
|
||||||
response,
|
response,
|
||||||
MHD_NO);
|
MHD_NO,
|
||||||
|
MHD_DIGEST_ALG_MD5);
|
||||||
MHD_destroy_response (response);
|
MHD_destroy_response (response);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -90,11 +91,12 @@ ahc_echo (void *cls,
|
|||||||
MHD_RESPMEM_PERSISTENT);
|
MHD_RESPMEM_PERSISTENT);
|
||||||
if (NULL == response)
|
if (NULL == response)
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
ret = MHD_queue_auth_fail_response (connection, realm,
|
ret = MHD_queue_auth_fail_response2 (connection, realm,
|
||||||
MY_OPAQUE_STR,
|
MY_OPAQUE_STR,
|
||||||
response,
|
response,
|
||||||
(res == MHD_INVALID_NONCE) ? MHD_YES :
|
(res == MHD_INVALID_NONCE) ? MHD_YES :
|
||||||
MHD_NO);
|
MHD_NO,
|
||||||
|
MHD_DIGEST_ALG_MD5);
|
||||||
MHD_destroy_response (response);
|
MHD_destroy_response (response);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ ahc_echo (void *cls,
|
|||||||
password,
|
password,
|
||||||
300,
|
300,
|
||||||
MHD_DIGEST_ALG_SHA256);
|
MHD_DIGEST_ALG_SHA256);
|
||||||
free (username);
|
MHD_free (username);
|
||||||
if ( (ret_i == MHD_INVALID_NONCE) ||
|
if ( (ret_i == MHD_INVALID_NONCE) ||
|
||||||
(ret_i == MHD_NO) )
|
(ret_i == MHD_NO) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,10 +107,11 @@ ahc_echo (void *cls,
|
|||||||
response = MHD_create_response_from_buffer (strlen (DENIED),
|
response = MHD_create_response_from_buffer (strlen (DENIED),
|
||||||
DENIED,
|
DENIED,
|
||||||
MHD_RESPMEM_PERSISTENT);
|
MHD_RESPMEM_PERSISTENT);
|
||||||
ret = MHD_queue_auth_fail_response (connection, realm,
|
ret = MHD_queue_auth_fail_response2 (connection, realm,
|
||||||
MY_OPAQUE,
|
MY_OPAQUE,
|
||||||
response,
|
response,
|
||||||
MHD_NO);
|
MHD_NO,
|
||||||
|
MHD_DIGEST_ALG_MD5);
|
||||||
MHD_destroy_response (response);
|
MHD_destroy_response (response);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -118,7 +119,7 @@ ahc_echo (void *cls,
|
|||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
300);
|
300);
|
||||||
free (username);
|
MHD_free (username);
|
||||||
if ( (ret_i == MHD_INVALID_NONCE) ||
|
if ( (ret_i == MHD_INVALID_NONCE) ||
|
||||||
(ret_i == MHD_NO) )
|
(ret_i == MHD_NO) )
|
||||||
{
|
{
|
||||||
@@ -127,11 +128,12 @@ ahc_echo (void *cls,
|
|||||||
MHD_RESPMEM_PERSISTENT);
|
MHD_RESPMEM_PERSISTENT);
|
||||||
if (NULL == response)
|
if (NULL == response)
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
ret = MHD_queue_auth_fail_response (connection, realm,
|
ret = MHD_queue_auth_fail_response2 (connection, realm,
|
||||||
MY_OPAQUE,
|
MY_OPAQUE,
|
||||||
response,
|
response,
|
||||||
(ret_i == MHD_INVALID_NONCE) ?
|
(ret_i == MHD_INVALID_NONCE) ?
|
||||||
MHD_YES : MHD_NO);
|
MHD_YES : MHD_NO,
|
||||||
|
MHD_DIGEST_ALG_MD5);
|
||||||
MHD_destroy_response (response);
|
MHD_destroy_response (response);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user