You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Christophe Jaillet <ch...@wanadoo.fr> on 2005/11/21 21:59:16 UTC

Cleanup in 'modules\aaa\mod_authnz_ldap.c'

Around line 865 in 'modules\aaa\mod_authnz_ldap.c', there is the following
sequence :

=====================================================
    /* Set all the values, or at least some sane defaults */
    if (sec->host) {
        char *p = apr_palloc(cmd->pool, strlen(sec->host) +
strlen(urld->lud_host) + 2);
        strcpy(p, urld->lud_host);
        strcat(p, " ");
        strcat(p, sec->host);
        sec->host = p;
   }
=====================================================

It can be shortened and speed-up by using the apr_pstrcat function :
=====================================================
    /* Set all the values, or at least some sane defaults */
    if (sec->host) {
        sec->host = apr_pstrcat(cmd->pool, urld->lud_host, " ", sec->host,
NULL);
   }
=====================================================

CJ