+/**
+ * Function to log curl debug messages with GNUNET_log
+ * @param curl handle
+ * @param type curl_infotype
+ * @param data data
+ * @param size size
+ * @param cls closure
+ * @return 0
+ */
+int curl_logger (CURL * curl, curl_infotype type , char * data, size_t size , void * cls)
+{
+ char * text = GNUNET_malloc(size+2);
+ if (type == CURLINFO_TEXT)
+ {
+ memcpy(text,data,size);
+ if (text[size-1] == '\n')
+ text[size] = '\0';
+ else
+ {
+ text[size] = '\n';
+ text[size+1] = '\0';
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,"CURL: Connection %X - %s", cls, text);
+ GNUNET_free(text);
+ }
+ return 0;
+}
+