- Timestamp:
- 2013-06-16T00:14:11Z (12 years ago)
- Branches:
- master
- Children:
- ab19567
- Parents:
- 777461b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/http_client.c
r777461b rdd7b931 536 536 /* A whole URL */ 537 537 url_t *url; 538 char *s ;538 char *s, *version, *headers; 539 539 const char *new_method; 540 540 … … 564 564 return TRUE; 565 565 } 566 headers = s; 566 567 567 568 /* More or less HTTP/1.0 compliant, from my reading of RFC 2616. … … 583 584 new_method = "POST"; 584 585 586 if( ( version = strstr( req->request, " HTTP/" ) ) && 587 ( s = strstr( version, "\r\n" ) ) ) 588 { 589 version ++; 590 version = g_strndup( version, s - version ); 591 } 592 else 593 version = g_strdup( "HTTP/1.0" ); 594 585 595 /* Okay, this isn't fun! We have to rebuild the request... :-( */ 586 new_request = g_strdup_printf( "%s %s HTTP/1.1\r\nHost: %s%s", 587 new_method, url->file, url->host, s ); 596 new_request = g_strdup_printf( "%s %s %s\r\nHost: %s%s", 597 new_method, url->file, version, 598 url->host, headers ); 588 599 589 600 new_host = g_strdup( url->host ); … … 597 608 598 609 g_free( url ); 610 g_free( version ); 599 611 } 600 612
Note: See TracChangeset
for help on using the changeset viewer.