Changeset 9c77fbf for lib/http_client.c


Ignore:
Timestamp:
2012-09-22T12:47:55Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6bef211
Parents:
c6fc24a (diff), 11ec078 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/http_client.c

    rc6fc24a r9c77fbf  
    7373                printf( "About to send HTTP request:\n%s\n", req->request );
    7474       
    75         return( req );
     75        return req;
    7676}
    7777
     
    198198        int evil_server = 0;
    199199        char buffer[2048];
    200         char *end1, *end2;
     200        char *end1, *end2, *s;
     201        size_t content_length;
    201202        int st;
    202203       
     
    481482        /* Assume that a closed connection means we're finished, this indeed
    482483           breaks with keep-alive connections and faulty connections. */
    483         req->finished = 1;
     484        /* req->finished = 1; */
    484485
    485486cleanup:
     
    488489        else
    489490                closesocket( req->fd );
     491       
     492        if( ( s = get_rfc822_header( req->reply_headers, "Content-Length", 0 ) ) &&
     493            sscanf( s, "%zd", &content_length ) == 1 )
     494        {
     495                if( content_length < req->body_size )
     496                {
     497                        req->status_code = -1;
     498                        g_free( req->status_string );
     499                        req->status_string = g_strdup( "Response truncated" );
     500                }
     501        }
     502        g_free( s );
    490503       
    491504        if( getenv( "BITLBEE_DEBUG" ) && req )
Note: See TracChangeset for help on using the changeset viewer.