You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2003/02/19 05:59:23 UTC

Re: svn commit: rev 4923 - in trunk/subversion: include libsvn_wc

On Tue, Feb 18, 2003 at 12:20:25PM -0600, cmpilato@tigris.org wrote:
>...
> +/* Public API */
> +void
> +svn_wc_get_username_provider (const svn_auth_provider_t **provider,
> +                              void **provider_baton,
> +                              apr_pool_t *pool)
> +{
> +  provider_baton_t *pb = apr_pcalloc (pool, sizeof (*pb));
>    svn_auth_provider_t *prov = apr_palloc (pool, sizeof (*prov));
>  
>    prov->cred_kind = SVN_AUTH_CRED_SIMPLE;
> -  prov->first_credentials = simple_wc_first_creds;
> +  prov->first_credentials = username_first_creds;
>    prov->next_credentials = NULL; /* no retry. */
> -  prov->save_credentials = simple_wc_save_creds;
> +  prov->save_credentials = username_save_creds;
>  
>    *provider = prov;
>    *provider_baton = pb;

The svn_auth_provider_t structure should be declared as a static const
structure. There is no reason to place it onto the heap -- the API was
designed to avoid the heap.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 4923 - in trunk/subversion: include libsvn_wc

Posted by cm...@collab.net.
Greg Stein <gs...@lyra.org> writes:

> On Tue, Feb 18, 2003 at 12:20:25PM -0600, cmpilato@tigris.org wrote:
> >...
> > +/* Public API */
> > +void
> > +svn_wc_get_username_provider (const svn_auth_provider_t **provider,
> > +                              void **provider_baton,
> > +                              apr_pool_t *pool)
> > +{
> > +  provider_baton_t *pb = apr_pcalloc (pool, sizeof (*pb));
> >    svn_auth_provider_t *prov = apr_palloc (pool, sizeof (*prov));
> >  
> >    prov->cred_kind = SVN_AUTH_CRED_SIMPLE;
> > -  prov->first_credentials = simple_wc_first_creds;
> > +  prov->first_credentials = username_first_creds;
> >    prov->next_credentials = NULL; /* no retry. */
> > -  prov->save_credentials = simple_wc_save_creds;
> > +  prov->save_credentials = username_save_creds;
> >  
> >    *provider = prov;
> >    *provider_baton = pb;
> 
> The svn_auth_provider_t structure should be declared as a static const
> structure. There is no reason to place it onto the heap -- the API was
> designed to avoid the heap.

Ah yes.  We switched to a heap allocation back when we were
dynamically (and conditionally) setting up the vtable functions.  Will
switch it (them, really) back.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org