Browse code

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.

Olle E. Johansson authored on 21/10/2015 12:46:04
Showing 2 changed files
... ...
@@ -3,18 +3,22 @@ The curl module - todo
3 3
 
4 4
 - connection parameters
5 5
 	timeout=x		- DONE
6
-	read=line/all
6
+	read=line/all		- Implemented in API, but not in parameter
7 7
 	tlsverify=on/off
8 8
 	failover=curlcon	Other curlcon that can be used for failover in case of 5xx response or timeout
9 9
 	httpredirect		- DONE
10 10
 	useragent		- DONE
11 11
 
12
+
12 13
 - Make sure modparams work
13 14
 	httpproxy		- Not working with curl
14 15
 	tls cert, key, ca	- Not working with curl yet
15 16
 	httpredirect		- done
16 17
 	timeout			- done
18
+	maxdatasize		- done
17 19
 	
20
+- Add XAVP parameter setting before running curl_connect
21
+
18 22
 - save fingerprint of cert for trust-on-first-use procedure
19 23
 
20 24
 - status for curlcon-object, needs to be object in process memory, so child_init
... ...
@@ -22,6 +26,8 @@ The curl module - todo
22 26
 	- function in dialplan - curlcon_exist(object)
23 27
 	- pv $curlstatus(object) ??
24 28
 
29
+- Figure out a way to communicate back the content-type of the response. Another pvar arg?
30
+
25 31
 - pv for curl error codes (result < 100)
26 32
 	$curlerror(code)	Result string - DONE
27 33
 
... ...
@@ -60,6 +60,10 @@ static int curL_query_url(struct sip_msg* _m, char* _url, char* _dst, const char
60 60
  */
61 61
 size_t write_function( void *ptr, size_t size, size_t nmemb, void *stream_ptr)
62 62
 {
63
+    /* A question here is if we can somehow signal maxdatasize and stop filling
64
+	buffers at maxdatasize - we don't need any more. Or just ignore and stop
65
+	allocating pkg memory at that point. A good todo.
66
+     */
63 67
     http_res_stream_t *stream = (http_res_stream_t *) stream_ptr;
64 68
 
65 69
     stream->buf = (char *) pkg_realloc(stream->buf, stream->curr_size +