Changeset 9779c18 for protocols/msn/passport.c
- Timestamp:
- 2006-06-03T20:20:43Z (18 years ago)
- Branches:
- master
- Children:
- 5973412
- Parents:
- a15c097 (diff), fb62f81f (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/passport.c
ra15c097 r9779c18 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 … … 145 153 } 146 154 147 #define PPR_REQUEST "GET /rdr/pprdr.asp HTTP/1.0\r\n\r\n"148 155 static int passport_retrieve_dalogin( gpointer func, gpointer data, char *header ) 149 156 { … … 155 162 rep->header = header; 156 163 157 req = http_dorequest ( "nexus.passport.com", 443, 1, PPR_REQUEST, passport_retrieve_dalogin_ready, rep );164 req = http_dorequest_url( "https://nexus.passport.com/rdr/pprdr.asp", passport_retrieve_dalogin_ready, rep ); 158 165 159 166 if( !req ) … … 169 176 char *urlend; 170 177 171 if( !g_slist_find( msn_connections, rep->data ) || !req->finished || !req->reply_headers)178 if( !g_slist_find( msn_connections, rep->data ) ) 172 179 { 173 180 destroy_reply( rep ); … … 175 182 } 176 183 184 if( !req->finished || !req->reply_headers || req->status_code != 200 ) 185 { 186 rep->error_string = g_strdup_printf( "HTTP error while fetching DALogin: %s", 187 req->status_string ? req->status_string : "Unknown error" ); 188 goto failure; 189 } 190 177 191 dalogin = strstr( req->reply_headers, "DALogin=" ); 178 192 179 193 if( !dalogin ) 194 { 195 rep->error_string = g_strdup( "Parse error while fetching DALogin" ); 180 196 goto failure; 197 } 181 198 182 199 dalogin += strlen( "DALogin=" ); … … 208 225 g_free( rep->result ); 209 226 g_free( rep->header ); 227 g_free( rep->error_string ); 210 228 g_free( rep ); 211 229 }
Note: See TracChangeset
for help on using the changeset viewer.