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/http_client.c

    r3087 r3089  
    218218 
    219219    hreq->tcp_state.current_send_size += sent; 
    220     TRACE_((THIS_FILE, "\nData sent: %d out of %d bytes\n",  
     220    TRACE_((THIS_FILE, "\nData sent: %d out of %d bytes",  
    221221           hreq->tcp_state.current_send_size, hreq->tcp_state.send_size)); 
    222222    if (hreq->tcp_state.current_send_size == hreq->tcp_state.send_size) { 
     
    280280    pj_http_req *hreq = (pj_http_req*) pj_activesock_get_user_data(asock); 
    281281 
    282     TRACE_((THIS_FILE, "\nData received: %d bytes\n", size)); 
     282    TRACE_((THIS_FILE, "\nData received: %d bytes", size)); 
    283283 
    284284    if (hreq->state == ABORTING) 
     
    472472    void *newdata; 
    473473    pj_scanner scanner; 
     474    pj_str_t s; 
    474475    pj_status_t status; 
    475476 
     
    509510        pj_scan_get_until_ch(&scanner, ' ', &response->version); 
    510511        pj_scan_advance_n(&scanner, 1, PJ_FALSE); 
    511         pj_scan_get_until_ch(&scanner, ' ', &response->status_code); 
     512        pj_scan_get_until_ch(&scanner, ' ', &s); 
     513        response->status_code = (pj_uint16_t)pj_strtoul(&s); 
    512514        pj_scan_advance_n(&scanner, 1, PJ_FALSE); 
    513515        pj_scan_get_until_ch(&scanner, '\n', &response->reason); 
     
    909911        pj_strcat2(&pkt, "\n"); 
    910912        pkt.ptr[pkt.slen] = 0; 
    911         TRACE_((THIS_FILE, "%s\n", pkt.ptr)); 
     913        TRACE_((THIS_FILE, "%s", pkt.ptr)); 
    912914    } else { 
    913915        pkt.ptr = hreq->param.reqdata.data; 
Note: See TracChangeset for help on using the changeset viewer.