[serf] r2496 committed - Remove unused authentication scheme callback for per-context...

0 views
Skip to first unread message

se...@googlecode.com

unread,
Apr 8, 2015, 2:39:09 PM4/8/15
to serf...@googlegroups.com
Revision: 2496
Author: chemodax
Date: Wed Apr 8 18:38:47 2015 UTC
Log: Remove unused authentication scheme callback for per-context
initialization. We may return it back if needed.

* auth/auth.c
(handle_auth_headers): Do not call init_ctx_func() for authn schemes.
* auth/auth.h
(serf__init_context_func_t): Remove.
(serf__authn_scheme_t): Remove INIT_CTX_FUNC field.

* auth/auth_basic.c
(serf__init_basic): Remove no-op function.
(serf__basic_authn_scheme): Update vtable definition.

* auth/auth_digest.c
(serf__init_digest): Remove no-op function.
(serf__digest_authn_scheme): Update vtable definition.

* auth/auth_spnego.c
(serf__init_spnego): Remove no-op function.
(serf__spnego_authn_scheme, serf__ntlm_authn_scheme): Update vtable
definition.

https://code.google.com/p/serf/source/detail?r=2496

Modified:
/trunk/auth/auth.c
/trunk/auth/auth.h
/trunk/auth/auth_basic.c
/trunk/auth/auth_digest.c
/trunk/auth/auth_spnego.c

=======================================
--- /trunk/auth/auth.c Wed Apr 8 17:46:40 2015 UTC
+++ /trunk/auth/auth.c Wed Apr 8 18:38:47 2015 UTC
@@ -123,19 +123,15 @@
serf__log(LOGLVL_INFO, LOGCOMP_AUTHN, __FILE__, conn->config,
"... matched: %s\n", scheme->name);

- /* If this is the first time we use this scheme on this context
and/or
- this connection, make sure to initialize the authentication
handler
- first. */
+ /* If this is the first time we use this scheme on this connection,
+ make sure to initialize the authentication handler first. */
if (authn_info->scheme != scheme) {
- status = scheme->init_ctx_func(code, ctx, ctx->pool);
- if (!status) {
- status = scheme->init_conn_func(scheme, code, conn,
- conn->pool);
- if (!status)
- authn_info->scheme = scheme;
- else
- authn_info->scheme = NULL;
- }
+ status = scheme->init_conn_func(scheme, code, conn,
+ conn->pool);
+ if (!status)
+ authn_info->scheme = scheme;
+ else
+ authn_info->scheme = NULL;
}

if (!status) {
=======================================
--- /trunk/auth/auth.h Wed Apr 8 17:46:40 2015 UTC
+++ /trunk/auth/auth.h Wed Apr 8 18:38:47 2015 UTC
@@ -35,16 +35,6 @@
const char *auth_attr,
apr_pool_t *pool);

-/**
- * For each authentication scheme we need an initialization function of
type
- * serf__init_context_func_t. This function will be called the first time
- * serf tries a specific authentication scheme handler.
- */
-typedef apr_status_t
-(*serf__init_context_func_t)(int code,
- serf_context_t *conn,
- apr_pool_t *pool);
-
/**
* For each authentication scheme we need an initialization function of
type
* serf__init_conn_func_t. This function will be called when a new
@@ -100,9 +90,6 @@
/* Internal code used for this authn type. */
int type;

- /* The context initialization function if any; otherwise, NULL */
- serf__init_context_func_t init_ctx_func;
-
/* The connection initialization function if any; otherwise, NULL */
serf__init_conn_func_t init_conn_func;

=======================================
--- /trunk/auth/auth_basic.c Wed Apr 8 17:46:40 2015 UTC
+++ /trunk/auth/auth_basic.c Wed Apr 8 18:38:47 2015 UTC
@@ -109,14 +109,6 @@

return APR_SUCCESS;
}
-
-static apr_status_t
-serf__init_basic(int code,
- serf_context_t *ctx,
- apr_pool_t *pool)
-{
- return APR_SUCCESS;
-}

/* For Basic authentication we expect all authn info to be the same for all
connections in the context to the same server (same realm, username,
@@ -191,7 +183,6 @@
"Basic",
"basic",
SERF_AUTHN_BASIC,
- serf__init_basic,
serf__init_basic_connection,
serf__handle_basic_auth,
serf__setup_request_basic_auth,
=======================================
--- /trunk/auth/auth_digest.c Wed Apr 8 17:46:40 2015 UTC
+++ /trunk/auth/auth_digest.c Wed Apr 8 18:38:47 2015 UTC
@@ -357,14 +357,6 @@

return status;
}
-
-static apr_status_t
-serf__init_digest(int code,
- serf_context_t *ctx,
- apr_pool_t *pool)
-{
- return APR_SUCCESS;
-}

static apr_status_t
serf__init_digest_connection(const serf__authn_scheme_t *scheme,
@@ -559,7 +551,6 @@
"Digest",
"digest",
SERF_AUTHN_DIGEST,
- serf__init_digest,
serf__init_digest_connection,
serf__handle_digest_auth,
serf__setup_request_digest_auth,
=======================================
--- /trunk/auth/auth_spnego.c Wed Apr 8 17:46:40 2015 UTC
+++ /trunk/auth/auth_spnego.c Wed Apr 8 18:38:47 2015 UTC
@@ -357,14 +357,6 @@

return APR_SUCCESS;
}
-
-apr_status_t
-serf__init_spnego(int code,
- serf_context_t *ctx,
- apr_pool_t *pool)
-{
- return APR_SUCCESS;
-}

/* A new connection is created to a server that's known to use
Kerberos. */
@@ -652,7 +644,6 @@
"Negotiate",
"negotiate",
SERF_AUTHN_NEGOTIATE,
- serf__init_spnego,
serf__init_spnego_connection,
serf__handle_spnego_auth,
serf__setup_request_spnego_auth,
@@ -664,7 +655,6 @@
"NTLM",
"ntlm",
SERF_AUTHN_NTLM,
- serf__init_spnego,
serf__init_spnego_connection,
serf__handle_spnego_auth,
serf__setup_request_spnego_auth,
Reply all
Reply to author
Forward
0 new messages