diff options
author | corvid <corvid@lavabit.com> | 2010-01-09 19:02:40 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2010-01-09 19:02:40 +0000 |
commit | 5027678a7f19497396a31f6baeb080ed922bf611 (patch) | |
tree | 1fb509a8dcfbd29432353fc1ed2878a65482f372 /src | |
parent | 2bae59f8efd33d3e0dbab25f9e2277aa04aef715 (diff) |
cookies: rm version, comment, comment url, port, Cookie2
Diffstat (limited to 'src')
-rw-r--r-- | src/cookies.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/cookies.c b/src/cookies.c index a25138cd..0793a670 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -141,7 +141,7 @@ void a_Cookies_freeall() void a_Cookies_set(Dlist *cookie_strings, const DilloUrl *set_url) { CookieControlAction action; - char *cmd, *cookie_string, *dpip_tag, numstr[16]; + char *cmd, *cookie_string, *dpip_tag; const char *path; int i; @@ -156,10 +156,9 @@ void a_Cookies_set(Dlist *cookie_strings, const DilloUrl *set_url) for (i = 0; (cookie_string = dList_nth_data(cookie_strings, i)); ++i) { path = URL_PATH_(set_url); - snprintf(numstr, 16, "%d", URL_PORT(set_url)); - cmd = a_Dpip_build_cmd("cmd=%s cookie=%s host=%s path=%s port=%s", + cmd = a_Dpip_build_cmd("cmd=%s cookie=%s host=%s path=%s", "set_cookie", cookie_string, URL_HOST_(set_url), - path ? path : "/", numstr); + path ? path : "/"); _MSG("Cookies.c: a_Cookies_set \n\t \"%s\" \n",cmd ); /* This call is commented because it doesn't guarantee the order @@ -178,7 +177,7 @@ void a_Cookies_set(Dlist *cookie_strings, const DilloUrl *set_url) */ char *a_Cookies_get_query(const DilloUrl *request_url) { - char *cmd, *dpip_tag, *query, numstr[16]; + char *cmd, *dpip_tag, *query; const char *path; CookieControlAction action; @@ -192,10 +191,9 @@ char *a_Cookies_get_query(const DilloUrl *request_url) } path = URL_PATH_(request_url); - snprintf(numstr, 16, "%d", URL_PORT(request_url)); - cmd = a_Dpip_build_cmd("cmd=%s scheme=%s host=%s path=%s port=%s", + cmd = a_Dpip_build_cmd("cmd=%s scheme=%s host=%s path=%s", "get_cookie", URL_SCHEME(request_url), - URL_HOST(request_url), path ? path : "/", numstr); + URL_HOST(request_url), path ? path : "/"); /* Get the answer from cookies.dpi */ _MSG("cookies.c: a_Dpi_send_blocking_cmd cmd = {%s}\n", cmd); @@ -203,15 +201,11 @@ char *a_Cookies_get_query(const DilloUrl *request_url) _MSG("cookies.c: after a_Dpi_send_blocking_cmd resp={%s}\n", dpip_tag); dFree(cmd); - query = dStrdup("Cookie2: $Version=\"1\"\r\n"); - if (dpip_tag != NULL) { - char *cookie = a_Dpip_get_attr(dpip_tag, "cookie"); - char *old_query = query; - query = dStrconcat(old_query, cookie, NULL); - dFree(old_query); + query = a_Dpip_get_attr(dpip_tag, "cookie"); dFree(dpip_tag); - dFree(cookie); + } else { + query = dStrdup(""); } return query; } |