2016-06-18 13:01 GMT+08:00 Felix Fietkau <n...@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().

Attachment: uclient-fixed-length.patch
Description: Binary data

_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to