* ecore_con_url: When download was broken in the middle, you could
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Nov 2009 18:45:51 +0000 (18:45 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Nov 2009 18:45:51 +0000 (18:45 +0000)
have a status of 200 without all data being downloaded. This should
fix this case.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@43805 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con_url.c

index 38c25bd..ccfb980 100644 (file)
@@ -1186,12 +1186,17 @@ _ecore_con_url_process_completed_jobs(Ecore_Con_Url *url_con_to_match)
                  e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
                  if (e)
                    {
-                      long status;     /* curl API uses long, not int */
-
                       e->url_con = url_con;
                       e->status = 0;
-                      curl_easy_getinfo(curlmsg->easy_handle, CURLINFO_RESPONSE_CODE, &status);
-                      e->status = status;
+                      if (curlmsg->data.result == CURLE_OK)
+                        {
+                           long status;        /* curl API uses long, not int */
+
+                           status = 0;
+                           curl_easy_getinfo(curlmsg->easy_handle, CURLINFO_RESPONSE_CODE, &status);
+                           e->status = status;
+                        }
+
                       _url_complete_push_event(ECORE_CON_EVENT_URL_COMPLETE, e);
                    }
                  curl_multi_remove_handle(curlm, url_con->curl_easy);