On Fri, Sep 06, 2002 at 10:16:10AM -0000, [EMAIL PROTECTED] wrote:
>   @@ -244,7 +247,9 @@
>    apr_status_t round_robin_create_req(profile_t *profile, request_t *r)
>    {
>        round_robin_profile_t *p;
>   +    int crdlen;
>        char *cookies;
>   +    char *enc_credtls, *credtls, *authz_hdr = NULL;
>        cookie_t *cook;
>       
>        p = (round_robin_profile_t*)profile; 
>   @@ -271,6 +276,19 @@
>        else
>            cookies = "";
>    
>   +    if (p->url[p->current_url].user) {
>   +        if (!p->url[p->current_url].password) {
>   +            apr_file_printf(local_stderr, "missing password for user 
> '%s'\n", p->url[p->current_url].user);
>   +            return APR_EGENERAL;
>   +   } else {

One nitpick is that lines shouldn't be over 80 characters.  So, the
apr_file_printf should be:
            apr_file_printf(local_stderr,
                            "missing password for user '%s'\n",
                            p->url[p->current_url].user);

We also don't use tabs.  Please remove them in favor of spaces.

You might want to take a quick glance at:

http://httpd.apache.org/dev/styleguide.html

>   +       credtls = apr_pstrcat(r->pool, p->url[p->current_url].user, ":", 
> p->url[p->current_url].password, NULL);
>   +       crdlen = strlen(credtls);
>   +       enc_credtls = (char *) apr_palloc(r->pool, 
> apr_base64_encode_len(crdlen) + 1);
>   +       apr_base64_encode(enc_credtls, credtls, crdlen);
>   +       authz_hdr = apr_pstrcat(r->pool, "Authorization: Basic ", 
> enc_credtls, CRLF, NULL);
>   +   }
>   +    }
>   +

Since crdlen isn't used outside of this else block, it seems that its
declaration should be inside the else block rather than at the
beginning of the function.  And, I'd guess it should be called
credlen - no need to mince one letter. 

Looks good though except for these minor nitpicks.  =)  -- justin

Reply via email to