- if(curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_status_code) == CURLE_OK && http_status_code == 200) {
- timed_thread_lock(curloc->p_timed_thread);
- (*curloc->process_function)(curloc->result, chunk.memory);
- timed_thread_unlock(curloc->p_timed_thread);
+ if (curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE,
+ &http_status_code) == CURLE_OK) {
+ switch (http_status_code) {
+ case 200:
+ timed_thread_lock(curloc->p_timed_thread);
+ (*curloc->process_function)(curloc->result, chunk.memory);
+ timed_thread_unlock(curloc->p_timed_thread);
+ break;
+ case 304:
+ break;
+ default:
+ NORM_ERR("curl: no data from server, got HTTP status %d %s",
+ http_status_code);
+ break;
+ }