title: easy_curl_perform returns error 26 (write error)
body: <p>Callback:</p>
  
  <pre><code>static size_t w_callback(char *ptr, size_t size, size_t nmemb, void *userdata) {
  #ifdef DBG
      add_debug("Curl callback is called from pastebin");
  #endif
      pastebin_ret_data = ptr;    
      return CURLE_OK;
  }
  </code></pre>
  
  <p>Main:</p>
  
  <pre><code>curl_easy_setopt(curl, CURLOPT_POST, (void*)1);
      curl_easy_setopt(curl, CURLOPT_URL, (void*)api_url_u8.c_str());
      curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &amp;curl_err_buf[0]);
      curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (void*)w_callback);
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (void*)postfields_u8.c_str());
      CURLcode res = curl_easy_perform(curl);  // blocking file transfer
  #ifdef DBG
      add_debug("easy_perform result: " + std::to_string(res) + 
                " error msg: " + &amp;curl_err_buf[0] );
  #endif
      curl_easy_cleanup(curl);
  </code></pre>
  
  <p>Debug:
  Curl callback is called from pastebin
  Time: Wed Dec 24 09:47:44 2014</p>
  
  <p>easy_perform result: 23 error msg: Failed writing body (0 != 30)</p>
  
  <p>What is the problem?</p>