Changeset 590

Show
Ignore:
Timestamp:
01/05/07 16:05:01 (2 years ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r589 r590  
    112007-01-05  A.D.F  <adefacc@tin.it> 
     2 
     3        * cherokee/connection.c:  
     4        - small formatting cleanups; 
     5        - substitute cherokee_buffer_add_va(s) with equivalent 
     6          cherokee_buffer_add_*() calls (micro speedups). 
    27 
    38        * cherokee/handler_error.c (cherokee_handler_error_add_headers): 
  • cherokee/trunk/cherokee/connection.c

    r527 r590  
    423423        } 
    424424 
    425         /* Digest Authenticatiom 
    426          * Eg: WWW-Authenticate: Digest realm="", qop="auth,auth-int", nonce="", opaque="" 
     425        /* Digest Authentication, Eg: 
     426         * WWW-Authenticate: Digest realm="", qop="auth,auth-int", 
     427         *                   nonce="", opaque="" 
    427428         */ 
    428429        if (conn->auth_type & http_auth_digest) { 
    429430                cherokee_buffer_t new_nonce = CHEROKEE_BUF_INIT; 
     431 
     432                cherokee_buffer_ensure_addlen (buffer, 
     433                                                32 + conn->realm_ref->len + 4 + 32 + 32); 
     434 
    430435                /* Realm 
    431436                 */ 
    432                 cherokee_buffer_ensure_addlen (buffer, 32 + conn->realm_ref->len + 4); 
    433437                cherokee_buffer_add_str (buffer, "WWW-Authenticate: Digest realm=\""); 
    434438                cherokee_buffer_add_buffer (buffer, conn->realm_ref); 
     
    438442                 */ 
    439443                cherokee_nonce_table_generate (CONN_SRV(conn)->nonces, conn, &new_nonce); 
    440                 cherokee_buffer_add_va (buffer, "nonce=\"%s\", ", new_nonce.buf); 
     444                /* "nonce=\"%s\", " 
     445                 */ 
     446                cherokee_buffer_add_str    (buffer, "nonce=\""); 
     447                cherokee_buffer_add_buffer (buffer, &new_nonce); 
     448                cherokee_buffer_add_str    (buffer, "\", "); 
    441449                                 
    442450                /* Quality of protection: auth, auth-int, auth-conf 
     
    12241232        /* Read the start position 
    12251233         */ 
    1226         while ((ptr[num_len] != '-') && (ptr[num_len] != '\0') && (num_len < tmp_size-1)) { 
     1234        while ((ptr[num_len] != '-') && 
     1235               (ptr[num_len] != '\0') && 
     1236               (num_len < tmp_size-1)) { 
    12271237                tmp[num_len] = ptr[num_len]; 
    12281238                num_len++; 
     
    12721282 
    12731283        return ret_ok; 
    1274          
    12751284} 
    12761285 
     
    12831292        char    *info     = NULL; 
    12841293        cuint_t  info_len = 0; 
    1285  
    1286         CHEROKEE_TEMP(buf,64); 
     1294        CHEROKEE_TEMP(buf, 64); 
    12871295 
    12881296        /* Get the header "Content-Lenght" content 
     
    13351343                 * to   http://www.alobbs.com/~alo/ 
    13361344                 */ 
    1337                 cherokee_buffer_add_va (&conn->redirect, "%s/", conn->request.buf); 
     1345                cherokee_buffer_add_buffer (&conn->redirect, &conn->request); 
     1346                cherokee_buffer_add_str    (&conn->redirect, "/"); 
    13381347 
    13391348                conn->error_code = http_moved_permanently;