You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by lg...@apache.org on 2011/02/13 13:30:06 UTC
svn commit: r1070224 - in /subversion/trunk/subversion/libsvn_ra_serf:
ra_serf.h serf.c
Author: lgo
Date: Sun Feb 13 12:30:06 2011
New Revision: 1070224
URL: http://svn.apache.org/viewvc?rev=1070224&view=rev
Log:
ra_serf: add support for http-auth-types config parameter.
* subversion/libsvn_ra_serf/serf.c
(load_http_auth_types): Convert strings from the config file to the serf bitmask.
(load_config): enable call to serf_config_authn_types.
* subversion/libsvn_ra_serf/ra_serf.h
(svn_ra_serf__authn_types): Not needed anymore now that authn support was removed
from ra_serf.
(struct svn_ra_serf__session_t): Authn_types type in serf is int.
Modified:
subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
subversion/trunk/subversion/libsvn_ra_serf/serf.c
Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1070224&r1=1070223&r2=1070224&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Sun Feb 13 12:30:06 2011
@@ -63,16 +63,6 @@ extern "C" {
/* Forward declarations. */
typedef struct svn_ra_serf__session_t svn_ra_serf__session_t;
-typedef enum svn_ra_serf__authn_types
-{
- svn_ra_serf__authn_none = 0x00,
- svn_ra_serf__authn_basic = 0x01,
- svn_ra_serf__authn_digest = 0x02,
- svn_ra_serf__authn_ntlm = 0x04,
- svn_ra_serf__authn_negotiate = 0x08,
- svn_ra_serf__authn_all = 0xFF,
-} svn_ra_serf__authn_types;
-
/* A serf connection and optionally associated SSL context. */
typedef struct svn_ra_serf__connection_t {
/* Our connection to a server. */
@@ -164,7 +154,7 @@ struct svn_ra_serf__session_t {
svn_error_t *pending_error;
/* List of authn types supported by the client.*/
- svn_ra_serf__authn_types authn_types;
+ int authn_types;
/* Maps SVN_RA_CAPABILITY_foo keys to "yes" or "no" values.
If a capability is not yet discovered, it is absent from the table.
Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1070224&r1=1070223&r2=1070224&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Sun Feb 13 12:30:06 2011
@@ -86,10 +86,10 @@ ra_serf_get_schemes(apr_pool_t *pool)
static svn_error_t *
load_http_auth_types(apr_pool_t *pool, svn_config_t *config,
const char *server_group,
- svn_ra_serf__authn_types *authn_types)
+ int *authn_types)
{
const char *http_auth_types = NULL;
- *authn_types = svn_ra_serf__authn_none;
+ *authn_types = SERF_AUTHN_NONE;
svn_config_get(config, &http_auth_types, SVN_CONFIG_SECTION_GLOBAL,
SVN_CONFIG_OPTION_HTTP_AUTH_TYPES, NULL);
@@ -109,13 +109,13 @@ load_http_auth_types(apr_pool_t *pool, s
{
auth_types_list = NULL;
if (svn_cstring_casecmp("basic", token) == 0)
- *authn_types |= svn_ra_serf__authn_basic;
+ *authn_types |= SERF_AUTHN_BASIC;
else if (svn_cstring_casecmp("digest", token) == 0)
- *authn_types |= svn_ra_serf__authn_digest;
+ *authn_types |= SERF_AUTHN_DIGEST;
else if (svn_cstring_casecmp("ntlm", token) == 0)
- *authn_types |= svn_ra_serf__authn_ntlm;
+ *authn_types |= SERF_AUTHN_NTLM;
else if (svn_cstring_casecmp("negotiate", token) == 0)
- *authn_types |= svn_ra_serf__authn_negotiate;
+ *authn_types |= SERF_AUTHN_NEGOTIATE;
else
return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
_("Invalid config: unknown http auth"
@@ -125,7 +125,7 @@ load_http_auth_types(apr_pool_t *pool, s
else
{
/* Nothing specified by the user, so accept all types. */
- *authn_types = svn_ra_serf__authn_all;
+ *authn_types = SERF_AUTHN_ALL;
}
return SVN_NO_ERROR;
@@ -307,8 +307,7 @@ load_config(svn_ra_serf__session_t *sess
/* Setup authentication. */
SVN_ERR(load_http_auth_types(pool, config, server_group,
&session->authn_types));
- /* TODO: convert string authn types to SERF_AUTHN bitmask.
- serf_config_authn_types(session->context, session->authn_types);*/
+ serf_config_authn_types(session->context, session->authn_types);
serf_config_credentials_callback(session->context,
svn_ra_serf__credentials_callback);