[sr-dev] git:master:9251a6f3: curl Update TODO and add a note for improvement in the way we handle reading from the server.
Olle E. Johansson
oej at edvina.net
Wed Oct 21 14:47:14 CEST 2015
Module: kamailio
Branch: master
Commit: 9251a6f386c27017c71e3cd468b20df16a65329d
URL: https://github.com/kamailio/kamailio/commit/9251a6f386c27017c71e3cd468b20df16a65329d
Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date: 2015-10-21T14:46:04+02:00
curl Update TODO and add a note for improvement in the way we handle reading from the server.
We may want to just drop data instead of allocating memory for it. It is not a good situation
to swallow anything.
---
Modified: modules/curl/TODO.txt
Modified: modules/curl/functions.c
---
Diff: https://github.com/kamailio/kamailio/commit/9251a6f386c27017c71e3cd468b20df16a65329d.diff
Patch: https://github.com/kamailio/kamailio/commit/9251a6f386c27017c71e3cd468b20df16a65329d.patch
---
diff --git a/modules/curl/TODO.txt b/modules/curl/TODO.txt
index 77ab3cc..0a728fd 100644
--- a/modules/curl/TODO.txt
+++ b/modules/curl/TODO.txt
@@ -3,18 +3,22 @@ The curl module - todo
- connection parameters
timeout=x - DONE
- read=line/all
+ read=line/all - Implemented in API, but not in parameter
tlsverify=on/off
failover=curlcon Other curlcon that can be used for failover in case of 5xx response or timeout
httpredirect - DONE
useragent - DONE
+
- Make sure modparams work
httpproxy - Not working with curl
tls cert, key, ca - Not working with curl yet
httpredirect - done
timeout - done
+ maxdatasize - done
+- Add XAVP parameter setting before running curl_connect
+
- save fingerprint of cert for trust-on-first-use procedure
- status for curlcon-object, needs to be object in process memory, so child_init
@@ -22,6 +26,8 @@ The curl module - todo
- function in dialplan - curlcon_exist(object)
- pv $curlstatus(object) ??
+- Figure out a way to communicate back the content-type of the response. Another pvar arg?
+
- pv for curl error codes (result < 100)
$curlerror(code) Result string - DONE
diff --git a/modules/curl/functions.c b/modules/curl/functions.c
index 17b85a9..4c9961e 100644
--- a/modules/curl/functions.c
+++ b/modules/curl/functions.c
@@ -60,6 +60,10 @@ static int curL_query_url(struct sip_msg* _m, char* _url, char* _dst, const char
*/
size_t write_function( void *ptr, size_t size, size_t nmemb, void *stream_ptr)
{
+ /* A question here is if we can somehow signal maxdatasize and stop filling
+ buffers at maxdatasize - we don't need any more. Or just ignore and stop
+ allocating pkg memory at that point. A good todo.
+ */
http_res_stream_t *stream = (http_res_stream_t *) stream_ptr;
stream->buf = (char *) pkg_realloc(stream->buf, stream->curr_size +
More information about the sr-dev
mailing list