Changes in lib/http_client.c [3f808ca:a72dc2b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/http_client.c
r3f808ca ra72dc2b 33 33 34 34 static gboolean http_connected( gpointer data, int source, b_input_condition cond ); 35 static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond );35 static gboolean http_ssl_connected( gpointer data, int returncode, void *source, b_input_condition cond ); 36 36 static gboolean http_incoming_data( gpointer data, int source, b_input_condition cond ); 37 37 static void http_free( struct http_request *req ); … … 47 47 if( ssl ) 48 48 { 49 req->ssl = ssl_connect( host, port, http_ssl_connected, req );49 req->ssl = ssl_connect( host, port, TRUE, http_ssl_connected, req ); 50 50 if( req->ssl == NULL ) 51 51 error = 1; … … 163 163 164 164 error: 165 req->status_string = g_strdup( "Error while writing HTTP request" ); 165 if( req->status_string == NULL ) 166 req->status_string = g_strdup( "Error while writing HTTP request" ); 166 167 167 168 req->func( req ); … … 170 171 } 171 172 172 static gboolean http_ssl_connected( gpointer data, void *source, b_input_condition cond )173 static gboolean http_ssl_connected( gpointer data, int returncode, void *source, b_input_condition cond ) 173 174 { 175 //The returncode is not used at the moment. 174 176 struct http_request *req = data; 175 177 176 178 if( source == NULL ) 179 { 180 if( returncode != 0 ) 181 { 182 char *err = ssl_verify_strerror( returncode ); 183 req->status_string = g_strdup_printf( 184 "Certificate verification problem 0x%x: %s", 185 returncode, err ? err : "Unknown" ); 186 g_free( err ); 187 } 177 188 return http_connected( data, -1, cond ); 189 } 178 190 179 191 req->fd = ssl_getfd( source ); … … 439 451 if( new_proto == PROTO_HTTPS ) 440 452 { 441 req->ssl = ssl_connect( new_host, new_port, http_ssl_connected, req );453 req->ssl = ssl_connect( new_host, new_port, TRUE, http_ssl_connected, req ); 442 454 if( req->ssl == NULL ) 443 455 error = 1;
Note: See TracChangeset
for help on using the changeset viewer.