comparison icon.c @ 263:b2c64cd550da

added error check code for testing in got_page_cb().
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 04 Dec 2008 02:03:35 +0900
parents e9a7c018a952
children b7ac562d758c
comparison
equal deleted inserted replaced
262:e9a7c018a952 263:b2c64cd550da
185 g_free(gotdata->user_name); 185 g_free(gotdata->user_name);
186 g_free(gotdata); 186 g_free(gotdata);
187 return; 187 return;
188 } 188 }
189 189
190 /* if we receive bad response */
191 if(!strstr(url_text, "HTTP/1.1 200 OK") &&
192 !strstr(url_text, "HTTP/1.0 200 OK")) {
193 if(data) {
194 data->requested = FALSE;
195 data->fetch_data = NULL;
196 }
197 g_free(gotdata->user_name);
198 g_free(gotdata);
199 return;
200 }
201
190 /* setup image url */ /* xxx need simplify --yaz */ 202 /* setup image url */ /* xxx need simplify --yaz */
191 g_regex_match(regp[regp_id], url_text, 0, &match_info); 203 g_regex_match(regp[regp_id], url_text, 0, &match_info);
192 if(!g_match_info_matches(match_info)) { 204 if(!g_match_info_matches(match_info)) {
193 g_match_info_free(match_info); 205 g_match_info_free(match_info);
194 206
196 twitter_debug("fall back to twitter default icon: %s\n", 208 twitter_debug("fall back to twitter default icon: %s\n",
197 gotdata->user_name); 209 gotdata->user_name);
198 url = g_strdup(TWITTER_DEFAULT_ICON_URL); 210 url = g_strdup(TWITTER_DEFAULT_ICON_URL);
199 } 211 }
200 else if(service == identica_service) { 212 else if(service == identica_service) {
201 twitter_debug("fall back to identica default icon\n"); 213 twitter_debug("fall back to identica default icon: %s\n",
214 gotdata->user_name);
202 url = g_strdup(IDENTICA_DEFAULT_ICON_URL); 215 url = g_strdup(IDENTICA_DEFAULT_ICON_URL);
203 } 216 }
204 else if(service == jisko_service) { 217 else if(service == jisko_service) {
205 twitter_debug("fall back to jisko default icon\n"); 218 twitter_debug("fall back to jisko default icon: %s\n",
219 gotdata->user_name);
206 url = g_strdup(JISKO_DEFAULT_ICON_URL); 220 url = g_strdup(JISKO_DEFAULT_ICON_URL);
207 } 221 }
208 else { 222 else {
209 twitter_debug("no image url found\n"); 223 twitter_debug("no image url found\n");
210 if(data) { 224 if(data) {