[LEDE-DEV] [PATCH uclient] enable --post-file, use "Content-Length" instead of chunked encoding

xinglp xinglp at gmail.com
Sat Jun 18 04:25:46 PDT 2016


2016-06-18 13:01 GMT+08:00 Felix Fietkau <nbd at nbd.name>:

>> I saw uclient_http_send_data() was only called once in
>> uclient-2016-06-16, what did I missed ?
> What you missed is the fact uclient-fetch is not the only user of the
> library code. The uclient library is used in a few other projects as
> well, some of which are not in the LEDE tree yet.
>
> Please make sure that any change you come up with to support --post-file
> does not break the library API.
>
>>> If you want to support using content_length instead of chunked encoding,
>>> please do so in an optional way that does not break the existing code.
>> That's a easy work, but where the multiple calls to send_data is
>> needed on earth, wget does not use that at all.
> If you upload a large file, it makes sense to not need to have it in
> memory completely.

I think this patch is better than others I posted.
It will behave same as wget while not break the library API.

I add an new API:
int uclient_http_set_contentlength(struct uclient *cl, int len);
We can call this first when we know the exact total length before send
data, it wont break uclient_http_send_data().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uclient-fixed-length.patch
Type: application/octet-stream
Size: 6048 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20160618/a996f9ff/attachment.obj>


More information about the Lede-dev mailing list