Add support for cookie#304
Add support for cookie#304Jason23347 wants to merge 2 commits intoaxel-download-accelerator:masterfrom
Conversation
|
Just an idea, but since cookies normally wouldn't change for a download, can't we have them mmapped? I think we can just write every Set-Cookie read from the server in a ready-to-use format on a file then mmap it and just reference that memory chunk when writing the requests... the same for translation from other formats like netscape. |
|
You're right, the cookies cannot be modified during download.
Later I will make a modification to add cookie header string instead of a `cookie_t` list to `conf`.
By the way, I think there's no need for axel to deal with `Set-Cookie`
headers.
In conditions where users need to use cookie, e.g., start downloading
after logging in, it's better to generate the cookie file with other
tools, not a downloader.
|
|
On 19/May/2020 17:41, Jason wrote:
You're right, the cookies cannot be modified during download.
Later I will make a modification to add cookie header string instead
of a `cookie_t` list to `conf`.
That sounds like the best option.
By the way, I think there's no need for axel to deal with `Set-Cookie`
headers.
In conditions where users need to use cookie, e.g., start downloading
after logging in, it's better to generate the cookie file with other
tools, not a downloader.
Indeed, probably there makes no sense to parse the server cookies.
|
Signed-off-by: Jason <jason23347@gmail.com>
d7c44b7 to
f5bbc14
Compare
|
This version of patch loads cookie file and write the cookie header string to
|
|
On 20/May/2020 05:49, Jason wrote:
This version of patch loads cookie file and write the cookie header
string to `conf->add_header` in `text.c`.
This may lead to 2 problems:
- Dumplicated headers if user add another cookie header using `-H`
option, and this is a minor problem.
Indeed, just an inconvenience, and in the case of cookies appending
works fine.
- Length of `conf->add_header` was set to `MAX_STRING`, it may not be
long enough. So should it be refactored with `abuf`?
Yes.
|
|
Ok, I have left a FIXME comment. The problem about length of |
Signed-off-by: Jason <jason23347@gmail.com>
|
Is this patch compatible with curl's |
Yes, it is. It would be nice of you to solve the conflicts and review my codes. However, for now, there are no scenarios where I use Axel with cookies... |
Thank you.
To be clear, I'm not the project owner, nor a C developer, so I wouldn't be much help trying to resolve the conflicts. |
fbfc36f to
3c21dc4
Compare
This patch aims to add basic support for cookies (only name and value fields).
-boption was added to specify a cookie file.However, I'm not sure wheather some of these codes are good,
abuf_printfinhttp_cookie?cookie_tinconf_t?