Changeset 881fd4e
- Timestamp:
- 2006-05-19T07:53:03Z (19 years ago)
- Branches:
- master
- Children:
- 41ca004, c53911e
- Parents:
- 75cde5d (diff), 1b5ab36 (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. - Location:
- protocols
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/http_client.c
r75cde5d r881fd4e 69 69 70 70 return( req ); 71 } 72 73 void *http_dorequest_url( char *url_string, http_input_function func, gpointer data ) 74 { 75 url_t *url = g_new0( url_t, 1 ); 76 char *request; 77 void *ret; 78 79 if( !url_set( url, url_string ) ) 80 { 81 g_free( url ); 82 return NULL; 83 } 84 85 if( url->proto != PROTO_HTTP && url->proto != PROTO_HTTPS ) 86 { 87 g_free( url ); 88 return NULL; 89 } 90 91 request = g_strdup_printf( "GET %s HTTP/1.0\r\n" 92 "Host: %s\r\n" 93 "User-Agent: BitlBee " BITLBEE_VERSION " " ARCH "/" CPU "\r\n" 94 "\r\n", url->file, url->host ); 95 96 ret = http_dorequest( url->host, url->port, 97 url->proto == PROTO_HTTPS, request, func, data ); 98 99 g_free( url ); 100 g_free( request ); 101 return ret; 71 102 } 72 103 … … 222 253 evil_server = 1; 223 254 } 224 else 255 else if( end1 ) 225 256 { 226 257 end1 += 2; 227 258 } 228 229 if( end1 ) 230 { 231 *end1 = 0; 232 233 if( evil_server ) 234 req->reply_body = end1 + 1; 235 else 236 req->reply_body = end1 + 2; 237 } 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 + req->bytes_read - req->reply_body; 238 272 239 273 if( ( end1 = strchr( req->reply_headers, ' ' ) ) != NULL ) -
protocols/http_client.h
r75cde5d r881fd4e 39 39 char *reply_headers; 40 40 char *reply_body; 41 int body_size; 41 42 int finished; 42 43 … … 53 54 54 55 void *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data ); 56 void *http_dorequest_url( char *url_string, http_input_function func, gpointer data );
Note: See TracChangeset
for help on using the changeset viewer.