Ignore:
Timestamp:
Feb 5, 2010 4:03:29 PM (12 years ago)
Author:
ming
Message:

Misc (#1018):

  • httpdemo: make the 2nd parameter (output filename) optional (result will be printed to stdout if output file is not provided.
  • remove trailing "\n" from PJ_LOG.
  • change response.status_code from pj_str_t to pj_uint16_t.
  • remove PJ_EPENDING status checking from on_complete.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/http_client.c

    r3087 r3089  
    134134    PJ_UNUSED_ARG(data); 
    135135 
    136     PJ_LOG(5, (THIS_FILE, "\nData received: %d bytes\n", size)); 
     136    PJ_LOG(5, (THIS_FILE, "\nData received: %d bytes", size)); 
    137137    if (size > 0) { 
    138138#ifdef VERBOSE 
     
    161161    *size = sendsz; 
    162162 
    163     PJ_LOG(5, (THIS_FILE, "\nSending data progress: %d out of %d bytes\n",  
     163    PJ_LOG(5, (THIS_FILE, "\nSending data progress: %d out of %d bytes",  
    164164           send_size, total_size)); 
    165165} 
     
    172172 
    173173    if (status == PJ_ECANCELLED) { 
    174         PJ_LOG(5, (THIS_FILE, "Request cancelled\n")); 
     174        PJ_LOG(5, (THIS_FILE, "Request cancelled")); 
    175175        return; 
    176176    } else if (status == PJ_ETIMEDOUT) { 
    177         PJ_LOG(5, (THIS_FILE, "Request timed out!\n")); 
     177        PJ_LOG(5, (THIS_FILE, "Request timed out!")); 
    178178        return; 
    179     } else if (status != PJ_SUCCESS && status != PJ_EPENDING) { 
    180         PJ_LOG(3, (THIS_FILE, "Error %d\n", status)); 
     179    } else if (status != PJ_SUCCESS) { 
     180        PJ_LOG(3, (THIS_FILE, "Error %d", status)); 
    181181        return; 
    182182    } 
    183     PJ_LOG(5, (THIS_FILE, "\nData completed: %d bytes\n", resp->size)); 
     183    PJ_LOG(5, (THIS_FILE, "\nData completed: %d bytes", resp->size)); 
    184184    if (resp->size > 0 && resp->data) { 
    185185#ifdef VERBOSE 
     
    198198 
    199199#ifdef VERBOSE 
    200     printf("%.*s, %.*s, %.*s\n", STR_PREC(resp->version), 
    201            STR_PREC(resp->status_code), STR_PREC(resp->reason)); 
     200    printf("%.*s, %d, %.*s\n", STR_PREC(resp->version), 
     201           resp->status_code, STR_PREC(resp->reason)); 
    202202    for (i = 0; i < resp->headers.count; i++) { 
    203203        printf("%.*s : %.*s\n",  
Note: See TracChangeset for help on using the changeset viewer.