Changeset 0eec386


Ignore:
Timestamp:
2006-05-18T16:41:18Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
41e5202
Parents:
266fe2f
Message:

Added a body_size attribute to http_client and fixed a possible NULL
dereference bug.

Location:
protocols
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/http_client.c

    r266fe2f r0eec386  
    253253                evil_server = 1;
    254254        }
    255         else
     255        else if( end1 )
    256256        {
    257257                end1 += 2;
    258258        }
    259        
    260         if( end1 )
    261         {
    262                 *end1 = 0;
    263                
    264                 if( evil_server )
    265                         req->reply_body = end1 + 1;
    266                 else
    267                         req->reply_body = end1 + 2;
    268         }
     259        else
     260        {
     261                goto cleanup;
     262        }
     263       
     264        *end1 = 0;
     265       
     266        if( evil_server )
     267                req->reply_body = end1 + 1;
     268        else
     269                req->reply_body = end1 + 2;
     270       
     271        req->body_size = req->reply_headers + bytes_read - req->reply_body;
    269272       
    270273        if( ( end1 = strchr( req->reply_headers, ' ' ) ) != NULL )
  • protocols/http_client.h

    r266fe2f r0eec386  
    3939        char *reply_headers;
    4040        char *reply_body;
     41        int body_size;
    4142        int finished;
    4243       
Note: See TracChangeset for help on using the changeset viewer.