mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-02 08:57:19 -04:00
Revert "Fix saving files from speccy.pl archives"
This reverts commit 29d85fdb3b
.
This commit is contained in:
parent
29d85fdb3b
commit
ab63ee8f82
@ -352,7 +352,7 @@ set_cookie(struct uri *uri, unsigned char *str)
|
|||||||
|
|
||||||
if (!parse_cookie_str(&cstr, str)) return;
|
if (!parse_cookie_str(&cstr, str)) return;
|
||||||
|
|
||||||
switch (parse_header_param(str, "path", &path, 0)) {
|
switch (parse_header_param(str, "path", &path)) {
|
||||||
unsigned char *path_end;
|
unsigned char *path_end;
|
||||||
|
|
||||||
case HEADER_PARAM_FOUND:
|
case HEADER_PARAM_FOUND:
|
||||||
@ -381,7 +381,7 @@ set_cookie(struct uri *uri, unsigned char *str)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parse_header_param(str, "domain", &domain, 0) == HEADER_PARAM_NOT_FOUND)
|
if (parse_header_param(str, "domain", &domain) == HEADER_PARAM_NOT_FOUND)
|
||||||
domain = memacpy(uri->host, uri->hostlen);
|
domain = memacpy(uri->host, uri->hostlen);
|
||||||
if (domain && domain[0] == '.')
|
if (domain && domain[0] == '.')
|
||||||
memmove(domain, domain + 1, strlen(domain));
|
memmove(domain, domain + 1, strlen(domain));
|
||||||
@ -424,7 +424,7 @@ set_cookie(struct uri *uri, unsigned char *str)
|
|||||||
unsigned char *date;
|
unsigned char *date;
|
||||||
time_t expires;
|
time_t expires;
|
||||||
|
|
||||||
switch (parse_header_param(str, "expires", &date, 0)) {
|
switch (parse_header_param(str, "expires", &date)) {
|
||||||
case HEADER_PARAM_FOUND:
|
case HEADER_PARAM_FOUND:
|
||||||
expires = parse_date(&date, NULL, 0, 1); /* Convert date to seconds. */
|
expires = parse_date(&date, NULL, 0, 1); /* Convert date to seconds. */
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ set_cookie(struct uri *uri, unsigned char *str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cookie->secure = (parse_header_param(str, "secure", NULL, 0)
|
cookie->secure = (parse_header_param(str, "secure", NULL)
|
||||||
== HEADER_PARAM_FOUND);
|
== HEADER_PARAM_FOUND);
|
||||||
|
|
||||||
#ifdef DEBUG_COOKIES
|
#ifdef DEBUG_COOKIES
|
||||||
|
@ -609,7 +609,7 @@ get_convert_table(unsigned char *head, int to_cp,
|
|||||||
|
|
||||||
if (!a) break;
|
if (!a) break;
|
||||||
|
|
||||||
parse_header_param(a, "charset", &ct_charset, 0);
|
parse_header_param(a, "charset", &ct_charset);
|
||||||
if (ct_charset) {
|
if (ct_charset) {
|
||||||
cp_index = get_cp_index(ct_charset);
|
cp_index = get_cp_index(ct_charset);
|
||||||
mem_free(ct_charset);
|
mem_free(ct_charset);
|
||||||
|
@ -65,7 +65,7 @@ get_content_filename(struct uri *uri, struct cache_entry *cached)
|
|||||||
pos = parse_header(cached->head, "Content-Disposition", NULL);
|
pos = parse_header(cached->head, "Content-Disposition", NULL);
|
||||||
if (!pos) return NULL;
|
if (!pos) return NULL;
|
||||||
|
|
||||||
parse_header_param(pos, "filename", &filename, 1);
|
parse_header_param(pos, "filename", &filename);
|
||||||
mem_free(pos);
|
mem_free(pos);
|
||||||
if (!filename) return NULL;
|
if (!filename) return NULL;
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ parse_header(unsigned char *head, const unsigned char *item, unsigned char **ptr
|
|||||||
* and cannot fail with HEADER_PARAM_OUT_OF_MEMORY. Some callers may
|
* and cannot fail with HEADER_PARAM_OUT_OF_MEMORY. Some callers may
|
||||||
* rely on this. */
|
* rely on this. */
|
||||||
enum parse_header_param
|
enum parse_header_param
|
||||||
parse_header_param(unsigned char *str, unsigned char *name, unsigned char **ret, int content_disposition)
|
parse_header_param(unsigned char *str, unsigned char *name, unsigned char **ret)
|
||||||
{
|
{
|
||||||
unsigned char *p = str;
|
unsigned char *p = str;
|
||||||
int namelen, plen = 0;
|
int namelen, plen = 0;
|
||||||
@ -247,10 +247,8 @@ parse_header_param(unsigned char *str, unsigned char *name, unsigned char **ret,
|
|||||||
|
|
||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
do {
|
do {
|
||||||
if (!content_disposition) {
|
|
||||||
p = strchr((const char *)p, ';');
|
p = strchr((const char *)p, ';');
|
||||||
if (!p) return HEADER_PARAM_NOT_FOUND;
|
if (!p) return HEADER_PARAM_NOT_FOUND;
|
||||||
}
|
|
||||||
|
|
||||||
while (*p && (*p == ';' || *p <= ' ')) p++;
|
while (*p && (*p == ';' || *p <= ' ')) p++;
|
||||||
if (strlen(p) < namelen) return HEADER_PARAM_NOT_FOUND;
|
if (strlen(p) < namelen) return HEADER_PARAM_NOT_FOUND;
|
||||||
|
@ -10,7 +10,7 @@ enum parse_header_param {
|
|||||||
};
|
};
|
||||||
|
|
||||||
unsigned char *parse_header(unsigned char *, const unsigned char *, unsigned char **);
|
unsigned char *parse_header(unsigned char *, const unsigned char *, unsigned char **);
|
||||||
enum parse_header_param parse_header_param(unsigned char *, unsigned char *, unsigned char **, int);
|
enum parse_header_param parse_header_param(unsigned char *, unsigned char *, unsigned char **);
|
||||||
unsigned char *get_header_param(unsigned char *, unsigned char *);
|
unsigned char *get_header_param(unsigned char *, unsigned char *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user