On Fri, 8 Oct 2010 18:53:19 -0300 Raphael Kubo da Costa <k...@profusion.mobi> said:
ok - bugger it. put this in. (just committed) > This signature change follows libcurl's behaviour more closely: > CURLOPT_POSTFIELDSIZE expects a long, and a value of -1 means that > content length calculation is forwarded to libcurl, which performs a > strlen() on CURLOPT_POSTFIELD. > --- > src/lib/ecore_con/Ecore_Con.h | 2 +- > src/lib/ecore_con/ecore_con_url.c | 19 ++++++++----------- > 2 files changed, 9 insertions(+), 12 deletions(-) > > diff --git a/src/lib/ecore_con/Ecore_Con.h b/src/lib/ecore_con/Ecore_Con.h > index 7d9ca12..201986d 100644 > --- a/src/lib/ecore_con/Ecore_Con.h > +++ b/src/lib/ecore_con/Ecore_Con.h > @@ -481,7 +481,7 @@ EAPI Eina_Bool ecore_con_url_httpauth_set > (Ecore_Con_Url *url_con, const char *password, > Eina_Bool safe); > EAPI Eina_Bool ecore_con_url_send(Ecore_Con_Url *url_con, > - const void *data, size_t length, > + const void *data, long length, > const char *content_type); > EAPI void ecore_con_url_time(Ecore_Con_Url *url_con, > Ecore_Con_Url_Time condition, > diff --git a/src/lib/ecore_con/ecore_con_url.c > b/src/lib/ecore_con/ecore_con_url.c index 73a8519..3c60253 100644 > --- a/src/lib/ecore_con/ecore_con_url.c > +++ b/src/lib/ecore_con/ecore_con_url.c > @@ -785,13 +785,13 @@ ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, > const char *username, * > * @param url_con Connection object to perform a request on, previously > created > * with ecore_con_url_new() or ecore_con_url_custom_new(). > - * @param data Payload (data sent on the request) > - * @param length Payload length > + * @param data Payload (data sent on the request) > + * @param length Payload length. If @c -1, rely on automatic length > + * calculation via @c strlen() on @p data. > * @param content_type Content type of the payload (e.g. text/xml) > * > * @return #EINA_TRUE on success, #EINA_FALSE on error. > * > - * > * @see ecore_con_url_custom_new() > * @see ecore_con_url_additional_headers_clear() > * @see ecore_con_url_additional_header_add() > @@ -800,7 +800,7 @@ ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, const > char *username, > * @see ecore_con_url_response_headers_get() > */ > EAPI Eina_Bool > -ecore_con_url_send(Ecore_Con_Url *url_con, const void *data, size_t length, > +ecore_con_url_send(Ecore_Con_Url *url_con, const void *data, long length, > const char *content_type) > { > #ifdef HAVE_CURL > @@ -830,17 +830,14 @@ ecore_con_url_send(Ecore_Con_Url *url_con, const void > *data, size_t length, > if (data) > { > - curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDS, data); > - curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, length); > - > - if (content_type && (strlen(content_type) < 200)) > + if ((content_type) && (strlen(content_type) < 200)) > { > - sprintf(tmp, "Content-type: %s", content_type); > + snprintf(tmp, sizeof(tmp), "Content-Type: %s", content_type); > url_con->headers = curl_slist_append(url_con->headers, tmp); > } > > - sprintf(tmp, "Content-length: %zu", length); > - url_con->headers = curl_slist_append(url_con->headers, tmp); > + curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDS, data); > + curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, length); > } > > switch (url_con->condition) > -- > 1.7.3.1 > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel