That was in reference to the check if the given headers were too large to fit
into the fixed-size buffer. If a malloc() fails, clearly the system is out of
memory.
Of course you're right :)
---
List admin:
Here's the updated patch.
0004-CURLOPT_TRAILERFUNCTION-support-chunked-encoding-req-7.29.0.patch
Description: Binary data
/***
* _ _ _
* Project ___| | | | _
Hi, I attach a patch with some changes and a test case.
In the patch:
-- I copy my 'trailer_headers_buf' into the original buffer and I free
mine at the end.
(no leaks from 'trailer_headers_buf' anymore)
-- I added a bool variable 'done' so as to update 'data-req.upload_done' at its
Chrysovaladis Datsios cdats...@gmail.com wrote:
In the patch:
...
(line 155 in patch):
+ trailer_headers_buf = malloc(headers_buf_size);
+ if(trailer_headers_buf == NULL)
+return CURLE_BAD_FUNCTION_ARGUMENT;
W/o looking at your code in details, why isn't this
W/o looking at your code in details, why isn't this returning
'CURLE_OUT_OF_MEMORY'?
--gv
According to Dan Fandrich:
---
And I'm not sure CURLE_OUT_OF_MEMORY is the
best error code here--the system is technically not out of memory. Maybe
On Fri, Mar 15, 2013 at 02:07:47PM +0200, Chrysovaladis Datsios wrote:
W/o looking at your code in details, why isn't this returning
'CURLE_OUT_OF_MEMORY'?
--gv
According to Dan Fandrich:
---
And I'm not sure CURLE_OUT_OF_MEMORY is the
best error
On Mon, 11 Mar 2013, Chrysovaladis Datsios wrote:
changes are in the attached patch.
Thanks. I would say that this is close to getting merged. My main issue is
remark #4 which kind of made #5 slip in...
1 - invalid email in the Author: field
2 - incomplete commit message
3 -
On Mon, Mar 11, 2013 at 06:09:29PM +0200, Chrysovaladis Datsios wrote:
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -193,6 +193,71 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn,
int bytes, int *nreadp)
/* copy the prefix to the buffer, leaving out the NUL */
Hi,
changes are in the attached patch.
Where does the magic number 3 come from?
I've changed it to 2. One endofline_native for each trailer header and
another at the end.
I'm not sure CURLE_OUT_OF_MEMORY is the
best error code here--the system is technically not out of memory. Maybe
Hi,
I'm sending a patch of my git commited changes (tryed to keep the
indent style, apologize if missed something)
3 - I would appreciate a way that starts off with a much smaller buffer but
that can grow if needed.
Now I start with a buffer of 256 and it grows up to 100K. Added checks
This is looking much cleaner than before! I've spotted a few issues
left, though.
On Thu, Feb 28, 2013 at 12:00:51PM +0200, Chrysovaladis Datsios wrote:
@@ -193,8 +194,66 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn,
int bytes, int *nreadp)
/* copy the prefix to the buffer,
On Thu, 21 Feb 2013, Chrysovaladis Datsios wrote:
I read no prohibition in putting read function inside main. It's just a
personal decision. I believe if the patch gets accepted a more formal code
example will be written.
It isn't C89 compliant code so it couldn't be used by us as-is, and we
Daniel hi,
it wasn't my intention to make your life hard. I too enjoy working
with(and for) libcurl and I want to write something useful for it.
You'll hear soon from me!
2013/2/22 Daniel Stenberg dan...@haxx.se:
On Thu, 21 Feb 2013, Chrysovaladis Datsios wrote:
I read no prohibition in
Hi,
I'm sending you a new version of the patch. It is attached.
0 - you didn't really follow our code style when it comes to indenting. A
minor nit, but still...
I tried to keep it, but the mail formater wash it off :)
1 - Can you think of a good reason why the callback would need to
Hi,
Am 21.02.2013 09:23, schrieb Chrysovaladis Datsios:
Following are a small documentation an example code using it.
did you test your sample?
Even if it will compile and run (which I doubt) its wrong ...
int main(void)
{
...
/* Read callback function */
size_t read_callback(void
did you test your sample?
Don't just copy paste code (mail formatting might have changed the code)
Gün.
I read no prohibition in putting read function inside main. It's just
a personal decision. I believe if the patch gets accepted a more
formal code example will be written.
Hiya,
Thanks for the patch. Now we're getting somewhere. This version is much better
than previous versions!
I do have a few questions and tips:
0 - you didn't really follow our code style when it comes to indenting. A
minor nit, but still...
1 - Can you think of a good reason why
Hi, I made some changes base on your suggestions:
I would prefer if we cut out the 'HTTP' from the name, and try to keep it
otherwise protocol agnostic. If we pretend this isn't HTTP specific, there's
no reason we can't use this callback for other protocols in another similar
scenario if
I don't see how this has changed. It will trigger in some cases when the
payload happens to match 0\r\n.
Now only when a trailerheader_callback has been set will enable any
further check for the last chunk and the addition of the trailer
headers as a payload.
Also, only the
On Mon, 28 Jan 2013, Chrysovaladis Datsios wrote:
Thanks for efforts and contribution!
+--+
| documentation |
+--+
curl_easy_setopt() option: CURLOPT_HTTPTRAILERFUNCTION
I would prefer if we cut out the 'HTTP' from the name,
I welcome this improvement but I agree with Dan Fandrich that it would be
more useful if implemented as a callback. My use cases for request trailers
involve signing operations on the message body where it's expensive to
buffer the whole request before starting to send the body… especially as
On 17 Jan 2013, at 12:35, Chrysovaladis Datsios wrote:
Hi,
this is a patch for the feature request as described in
http://sourceforge.net/p/curl/feature-requests/67/
the feature is a standard in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.40
I welcome this improvement but I
On Sat, 19 Jan 2013, Tim Bannister wrote:
I welcome this improvement but I agree with Dan Fandrich that it would be
more useful if implemented as a callback. My use cases for request trailers
involve signing operations on the message body where it's expensive to
buffer the whole request
Thank you both for your immediate response and comments.
Every comment was a great suggestion towards the correct
implementation of the feature. Please do review the following sections
as formed after your previous comments.
+--+
| documentation |
On 01/18/2013 02:51 PM, Chrysovaladis Datsios wrote:
The option is set before the curl_easy_perfom(1). The linked list of
HTTP trailer headers contains some initial values of those headers.
The initial values are not the values that will be sent finally at the
end of the transfer. The
Hi,
this is a patch for the feature request as described in
http://sourceforge.net/p/curl/feature-requests/67/
the feature is a standard in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.40
One can also refer at Chris Shiflett's Book HTTP: Developer's
Handbook from SAMS page 97.
On Thu, Jan 17, 2013 at 02:35:12PM +0200, Chrysovaladis Datsios wrote:
The feature is implemented as another in curl_easy_setopt() function.
This new option is named CURLOPT_HTTPTRAILERHEADER and adds the trailer
headers
appended on a curl_slist.
Example code snippet using the new feature:
On Thu, 17 Jan 2013, Dan Fandrich wrote:
+char tfield[CURL_MAX_HTTP_HEADER];
+strncpy(tfield, trailer_headers-data, tptr-trailer_headers-data+1);
This will overflow tfield given a long enough user-supplied header.
In addition to Dan's fine comments, allow me to point out
28 matches
Mail list logo