Changeset a2582c8 for protocols/msn/passport.c
- Timestamp:
- 2006-05-26T22:44:48Z (18 years ago)
- Branches:
- master
- Children:
- db28304
- Parents:
- fe23720
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/passport.c
rfe23720 ra2582c8 69 69 } 70 70 71 reqs = g_malloc( strlen( header ) + strlen( dummy ) + 128 ); 72 sprintf( reqs, "GET %s HTTP/1.0\r\n%s\r\n\r\n", dummy, header ); 71 reqs = g_strdup_printf( "GET %s HTTP/1.0\r\n%s\r\n\r\n", dummy, header ); 73 72 74 73 *dummy = 0; … … 88 87 struct passport_reply *rep = req->data; 89 88 90 if( !g_slist_find( msn_connections, rep->data ) || !req->finished || !req->reply_headers)89 if( !g_slist_find( msn_connections, rep->data ) ) 91 90 { 92 91 destroy_reply( rep ); … … 94 93 } 95 94 96 if( req-> status_code == 200 )95 if( req->finished && req->reply_headers && req->status_code == 200 ) 97 96 { 98 97 char *dummy; … … 109 108 rep->result = g_strdup( dummy ); 110 109 } 110 else 111 { 112 rep->error_string = g_strdup( "Could not parse Passport server response" ); 113 } 114 } 115 else 116 { 117 rep->error_string = g_strdup_printf( "HTTP error: %s", 118 req->status_string ? req->status_string : "Unknown error" ); 111 119 } 112 120 … … 169 177 char *urlend; 170 178 171 if( !g_slist_find( msn_connections, rep->data ) || !req->finished || !req->reply_headers)179 if( !g_slist_find( msn_connections, rep->data ) ) 172 180 { 173 181 destroy_reply( rep ); … … 175 183 } 176 184 185 if( !req->finished || !req->reply_headers || req->status_code != 200 ) 186 { 187 rep->error_string = g_strdup_printf( "HTTP error while fetching DALogin (%s)", 188 req->status_string ? req->status_string : "Unknown error" ); 189 goto failure; 190 } 191 177 192 dalogin = strstr( req->reply_headers, "DALogin=" ); 178 193 179 194 if( !dalogin ) 195 { 196 rep->error_string = g_strdup( "Parse error while fetching DALogin" ); 180 197 goto failure; 198 } 181 199 182 200 dalogin += strlen( "DALogin=" ); … … 208 226 g_free( rep->result ); 209 227 g_free( rep->header ); 228 g_free( rep->error_string ); 210 229 g_free( rep ); 211 230 }
Note: See TracChangeset
for help on using the changeset viewer.