-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for cookie #304
base: master
Are you sure you want to change the base?
Add support for cookie #304
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 <[email protected]>
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 <[email protected]>
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).
-b
option was added to specify a cookie file.However, I'm not sure wheather some of these codes are good,
abuf_printf
inhttp_cookie
?cookie_t
inconf_t
?