gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 137/153: cookies: support creation-time attribute f


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 137/153: cookies: support creation-time attribute for cookies
Date: Tue, 11 Sep 2018 12:53:28 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit e2ef8d6fa11b2345e10b89db525920f2a0d5fd79
Author: Daniel Gustafsson <address@hidden>
AuthorDate: Tue Aug 28 11:28:50 2018 +0200

    cookies: support creation-time attribute for cookies
    
    According to RFC6265 section 5.4, cookies with equal path lengths
    SHOULD be sorted by creation-time (earlier first). This adds a
    creation-time record to the cookie struct in order to make cookie
    sorting more deterministic. The creation-time is defined as the
    order of the cookies in the jar, the first cookie read fro the
    jar being the oldest. The creation-time is thus not serialized
    into the jar. Also remove the strcmp() matching in the sorting as
    there is no lexicographic ordering in RFC6265. Existing tests are
    updated to match.
    
    Closes #2524
---
 lib/cookie.c        | 68 ++++++++++++++++++++++++++++++++++++++++-------------
 lib/cookie.h        |  4 +++-
 tests/data/test1105 |  2 +-
 tests/data/test1136 |  2 +-
 tests/data/test1151 |  4 ++--
 tests/data/test1216 |  2 +-
 tests/data/test1415 |  6 ++---
 tests/data/test31   | 62 ++++++++++++++++++++++++------------------------
 tests/data/test46   | 16 ++++++-------
 tests/data/test506  | 28 +++++++++++-----------
 tests/data/test61   |  4 ++--
 tests/data/test8    |  2 +-
 12 files changed, 119 insertions(+), 81 deletions(-)

diff --git a/lib/cookie.c b/lib/cookie.c
index 72aaa7636..5a8e4fc65 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -40,7 +40,7 @@ struct Cookie *Curl_cookie_add(struct Curl_easy *data,
         received from a server.
 
         The function need to replace previously stored lines that this new
-        line superceeds.
+        line supersedes.
 
         It may remove lines that are expired.
 
@@ -874,9 +874,10 @@ Curl_cookie_add(struct Curl_easy *data,
   }
 
   co->livecookie = c->running;
+  co->creationtime = ++c->lastct;
 
   /* now, we have parsed the incoming line, we must now check if this
-     superceeds an already existing cookie, which it may if the previous have
+     supersedes an already existing cookie, which it may if the previous have
      the same domain and path as this */
 
   /* at first, remove expired cookies */
@@ -952,6 +953,9 @@ Curl_cookie_add(struct Curl_easy *data,
       if(replace_old) {
         co->next = clist->next; /* get the next-pointer first */
 
+        /* when replacing, creationtime is kept from old */
+        co->creationtime = clist->creationtime;
+
         /* then free all the old pointers */
         free(clist->name);
         free(clist->value);
@@ -1141,12 +1145,24 @@ static int cookie_sort(const void *p1, const void *p2)
   if(l1 != l2)
     return (l2 > l1) ? 1 : -1 ;  /* avoid size_t <=> int conversions */
 
-  /* 3 - compare cookie names */
-  if(c1->name && c2->name)
-    return strcmp(c1->name, c2->name);
+  /* 3 - compare cookie name lengths */
+  l1 = c1->name ? strlen(c1->name) : 0;
+  l2 = c2->name ? strlen(c2->name) : 0;
 
-  /* sorry, can't be more deterministic */
-  return 0;
+  if(l1 != l2)
+    return (l2 > l1) ? 1 : -1;
+
+  /* 4 - compare cookie creation time */
+  return (c2->creationtime > c1->creationtime) ? 1 : -1;
+}
+
+/* sort cookies only according to creation time */
+static int cookie_sort_ct(const void *p1, const void *p2)
+{
+  struct Cookie *c1 = *(struct Cookie **)p1;
+  struct Cookie *c2 = *(struct Cookie **)p2;
+
+  return (c2->creationtime > c1->creationtime) ? 1 : -1;
 }
 
 #define CLONE(field)                     \
@@ -1175,6 +1191,7 @@ static struct Cookie *dup_cookie(struct Cookie *src)
     d->secure = src->secure;
     d->livecookie = src->livecookie;
     d->httponly = src->httponly;
+    d->creationtime = src->creationtime;
   }
   return d;
 
@@ -1439,6 +1456,8 @@ static int cookie_output(struct CookieInfo *c, const char 
*dumphere)
   bool use_stdout = FALSE;
   char *format_ptr;
   unsigned int i;
+  unsigned int j;
+  struct Cookie **array;
 
   if((NULL == c) || (0 == c->numcookies))
     /* If there are no known cookies, we don't write or even create any
@@ -1452,6 +1471,10 @@ static int cookie_output(struct CookieInfo *c, const 
char *dumphere)
   if(0 == c->numcookies)
     return 0;
 
+  array = malloc(sizeof(struct Cookie *) * c->numcookies);
+  if(!array)
+    return 1;
+
   if(!strcmp("-", dumphere)) {
     /* use stdout */
     out = stdout;
@@ -1459,8 +1482,10 @@ static int cookie_output(struct CookieInfo *c, const 
char *dumphere)
   }
   else {
     out = fopen(dumphere, FOPEN_WRITETEXT);
-    if(!out)
+    if(!out) {
+      free(array);
       return 1; /* failure */
+    }
   }
 
   fputs("# Netscape HTTP Cookie File\n"
@@ -1468,22 +1493,33 @@ static int cookie_output(struct CookieInfo *c, const 
char *dumphere)
         "# This file was generated by libcurl! Edit at your own risk.\n\n",
         out);
 
+  j = 0;
   for(i = 0; i < COOKIE_HASH_SIZE; i++) {
     for(co = c->cookies[i]; co; co = co->next) {
       if(!co->domain)
         continue;
-      format_ptr = get_netscape_format(co);
-      if(format_ptr == NULL) {
-        fprintf(out, "#\n# Fatal libcurl error\n");
-        if(!use_stdout)
-          fclose(out);
-        return 1;
+      array[j++] = co;
+    }
+  }
+
+  qsort(array, c->numcookies, sizeof(struct Cookie *), cookie_sort_ct);
+
+  for(i = 0; i < j; i++) {
+    format_ptr = get_netscape_format(array[i]);
+    if(format_ptr == NULL) {
+      fprintf(out, "#\n# Fatal libcurl error\n");
+      if(!use_stdout) {
+        free(array);
+        fclose(out);
       }
-      fprintf(out, "%s\n", format_ptr);
-      free(format_ptr);
+      return 1;
     }
+    fprintf(out, "%s\n", format_ptr);
+    free(format_ptr);
   }
 
+  free(array);
+
   if(!use_stdout)
     fclose(out);
 
diff --git a/lib/cookie.h b/lib/cookie.h
index 79b5928dc..a9f90ca71 100644
--- a/lib/cookie.h
+++ b/lib/cookie.h
@@ -34,7 +34,7 @@ struct Cookie {
   char *domain;      /* domain = <this> */
   curl_off_t expires;  /* expires = <this> */
   char *expirestr;   /* the plain text version */
-  bool tailmatch;    /* weather we do tail-matchning of the domain name */
+  bool tailmatch;    /* whether we do tail-matching of the domain name */
 
   /* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */
   char *version;     /* Version = <value> */
@@ -43,6 +43,7 @@ struct Cookie {
   bool secure;       /* whether the 'secure' keyword was used */
   bool livecookie;   /* updated from a server, not a stored file */
   bool httponly;     /* true if the httponly directive is present */
+  int creationtime;  /* time when the cookie was written */
 };
 
 #define COOKIE_HASH_SIZE 256
@@ -55,6 +56,7 @@ struct CookieInfo {
   bool running;    /* state info, for cookie adding information */
   long numcookies; /* number of cookies in the "jar" */
   bool newsession; /* new session, discard session cookies on load */
+  int lastct;      /* last creation-time used in the jar */
 };
 
 /* This is the maximum line length we accept for a cookie line. RFC 2109
diff --git a/tests/data/test1105 b/tests/data/test1105
index 4b5e0c836..782044583 100644
--- a/tests/data/test1105
+++ b/tests/data/test1105
@@ -58,8 +58,8 @@ userid=myname&password=mypassword
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-127.0.0.1      FALSE   /we/want/       FALSE   0       foobar  name
 127.0.0.1      FALSE   "/silly/"       FALSE   0       mismatch        this
+127.0.0.1      FALSE   /we/want/       FALSE   0       foobar  name
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test1136 b/tests/data/test1136
index 2030bd271..e18a92325 100644
--- a/tests/data/test1136
+++ b/tests/data/test1136
@@ -56,9 +56,9 @@ http://www.example.ck/1136 http://www.ck/1136 
http://z-1.compute-1.amazonaws.com
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
+.z-1.compute-1.amazonaws.com   TRUE    /       FALSE   0       test5   
forbidden5
 .www.ck        TRUE    /       FALSE   0       test4   allowed4
 .www.example.ck        TRUE    /       FALSE   0       test2   allowed2
-.z-1.compute-1.amazonaws.com   TRUE    /       FALSE   0       test5   
forbidden5
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test1151 b/tests/data/test1151
index cc9c9b523..d793944c3 100644
--- a/tests/data/test1151
+++ b/tests/data/test1151
@@ -58,9 +58,9 @@ Accept: */*
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-127.0.0.1      FALSE   /       FALSE   0       foobar  name
-127.0.0.1      FALSE   /       FALSE   0       
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 [...]
 127.0.0.1      FALSE   /       FALSE   0       
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
 [...]
+127.0.0.1      FALSE   /       FALSE   0       
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 [...]
+127.0.0.1      FALSE   /       FALSE   0       foobar  name
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test1216 b/tests/data/test1216
index 5beda797d..be0f5c77a 100644
--- a/tests/data/test1216
+++ b/tests/data/test1216
@@ -51,7 +51,7 @@ GET http://example.fake/c/1216 HTTP/1.1
 Host: example.fake
 Accept: */*
 Proxy-Connection: Keep-Alive
-Cookie: moo2=indeed; moo3=indeed
+Cookie: moo3=indeed; moo2=indeed
 
 GET http://bexample.fake/c/1216 HTTP/1.1
 Host: bexample.fake
diff --git a/tests/data/test1415 b/tests/data/test1415
index 560440407..f5660ba66 100644
--- a/tests/data/test1415
+++ b/tests/data/test1415
@@ -66,10 +66,10 @@ Proxy-Connection: Keep-Alive
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-.example.com   TRUE    /       FALSE   0       test1value      test1
-.example.com   TRUE    /       FALSE   2114380800      test2value      test2
-.example.com   TRUE    /       FALSE   2114380800      test4value      test4
 .example.com   TRUE    /       FALSE   2114380800      test7value      test7
+.example.com   TRUE    /       FALSE   2114380800      test4value      test4
+.example.com   TRUE    /       FALSE   2114380800      test2value      test2
+.example.com   TRUE    /       FALSE   0       test1value      test1
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test31 b/tests/data/test31
index 54e360a46..78f3766e9 100644
--- a/tests/data/test31
+++ b/tests/data/test31
@@ -100,38 +100,38 @@ Accept: */*
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-127.0.0.1      FALSE   /silly/ FALSE   0       ismatch this
-127.0.0.1      FALSE   /overwrite      FALSE   0       overwrite       this2
-127.0.0.1      FALSE   /secure1/       TRUE    0       sec1value       secure1
-127.0.0.1      FALSE   /secure2/       TRUE    0       sec2value       secure2
-127.0.0.1      FALSE   /secure3/       TRUE    0       sec3value       secure3
-127.0.0.1      FALSE   /secure4/       TRUE    0       sec4value       secure4
-127.0.0.1      FALSE   /secure5/       TRUE    0       sec5value       secure5
-127.0.0.1      FALSE   /secure6/       TRUE    0       sec6value       secure6
-127.0.0.1      FALSE   /secure7/       TRUE    0       sec7value       secure7
-127.0.0.1      FALSE   /secure8/       TRUE    0       sec8value       secure8
-127.0.0.1      FALSE   /secure9/       TRUE    0       secure  very1
-#HttpOnly_127.0.0.1    FALSE   /p1/    FALSE   0       httpo1  value1
-#HttpOnly_127.0.0.1    FALSE   /p2/    FALSE   0       httpo2  value2
-#HttpOnly_127.0.0.1    FALSE   /p3/    FALSE   0       httpo3  value3
-#HttpOnly_127.0.0.1    FALSE   /p4/    FALSE   0       httpo4  value4
-#HttpOnly_127.0.0.1    FALSE   /p4/    FALSE   0       httponly        myvalue1
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec      myvalue2
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec2     myvalue3
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec3     myvalue4
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec4     myvalue5
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec5     myvalue6
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec6     myvalue7
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec7     myvalue8
-#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec8     myvalue9
-127.0.0.1      FALSE   /       FALSE   0       partmatch       present
-127.0.0.1      FALSE   /we/want/       FALSE   2054030187      nodomain        
value
-#HttpOnly_127.0.0.1    FALSE   /silly/ FALSE   0       magic   yessir
-127.0.0.1      FALSE   /we/want/       FALSE   0       blexp   yesyes
-127.0.0.1      FALSE   /we/want/       FALSE   0       withspaces      yes  
within and around
-127.0.0.1      FALSE   /we/want/       FALSE   0       withspaces2     before 
equals
-127.0.0.1      FALSE   /we/want/       FALSE   0       prespace        yes 
before
 127.0.0.1      FALSE   /we/want/       TRUE    0       securewithspace after
+127.0.0.1      FALSE   /we/want/       FALSE   0       prespace        yes 
before
+127.0.0.1      FALSE   /we/want/       FALSE   0       withspaces2     before 
equals
+127.0.0.1      FALSE   /we/want/       FALSE   0       withspaces      yes  
within and around
+127.0.0.1      FALSE   /we/want/       FALSE   0       blexp   yesyes
+#HttpOnly_127.0.0.1    FALSE   /silly/ FALSE   0       magic   yessir
+127.0.0.1      FALSE   /we/want/       FALSE   2054030187      nodomain        
value
+127.0.0.1      FALSE   /       FALSE   0       partmatch       present
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec8     myvalue9
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec7     myvalue8
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec6     myvalue7
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec5     myvalue6
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec4     myvalue5
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec3     myvalue4
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec2     myvalue3
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec      myvalue2
+#HttpOnly_127.0.0.1    FALSE   /p4/    FALSE   0       httponly        myvalue1
+#HttpOnly_127.0.0.1    FALSE   /p4/    FALSE   0       httpo4  value4
+#HttpOnly_127.0.0.1    FALSE   /p3/    FALSE   0       httpo3  value3
+#HttpOnly_127.0.0.1    FALSE   /p2/    FALSE   0       httpo2  value2
+#HttpOnly_127.0.0.1    FALSE   /p1/    FALSE   0       httpo1  value1
+127.0.0.1      FALSE   /secure9/       TRUE    0       secure  very1
+127.0.0.1      FALSE   /secure8/       TRUE    0       sec8value       secure8
+127.0.0.1      FALSE   /secure7/       TRUE    0       sec7value       secure7
+127.0.0.1      FALSE   /secure6/       TRUE    0       sec6value       secure6
+127.0.0.1      FALSE   /secure5/       TRUE    0       sec5value       secure5
+127.0.0.1      FALSE   /secure4/       TRUE    0       sec4value       secure4
+127.0.0.1      FALSE   /secure3/       TRUE    0       sec3value       secure3
+127.0.0.1      FALSE   /secure2/       TRUE    0       sec2value       secure2
+127.0.0.1      FALSE   /secure1/       TRUE    0       sec1value       secure1
+127.0.0.1      FALSE   /overwrite      FALSE   0       overwrite       this2
+127.0.0.1      FALSE   /silly/ FALSE   0       ismatch this
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test46 b/tests/data/test46
index 64a7b86e4..5d849df75 100644
--- a/tests/data/test46
+++ b/tests/data/test46
@@ -74,16 +74,16 @@ Cookie: empty=; mooo2=indeed2; mooo=indeed
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-www.fake.come  FALSE   /       FALSE   2022144953      cookiecliente   si
-domain..tld    FALSE   /       FALSE   2139150993      mooo    indeed
-#HttpOnly_domain..tld  FALSE   /want   FALSE   2139150993      mooo2   indeed2
-domain..tld    FALSE   /want   FALSE   0       empty   
-domain..tld    FALSE   /       FALSE   2054030187      ckyPersistent   
permanent
-domain..tld    FALSE   /       FALSE   0       ckySession      temporary
-domain..tld    FALSE   /       FALSE   0       ASPSESSIONIDQGGQQSJJ    
GKNBDIFAAOFDPDAIEAKDIBKE
-domain..tld    FALSE   /       FALSE   0       justaname       
 domain..tld    FALSE   /want/  FALSE   0       simplyhuge      
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
 [...]
+domain..tld    FALSE   /       FALSE   0       justaname       
+domain..tld    FALSE   /       FALSE   0       ASPSESSIONIDQGGQQSJJ    
GKNBDIFAAOFDPDAIEAKDIBKE
+domain..tld    FALSE   /       FALSE   0       ckySession      temporary
+domain..tld    FALSE   /       FALSE   2054030187      ckyPersistent   
permanent
+domain..tld    FALSE   /want   FALSE   0       empty   
+#HttpOnly_domain..tld  FALSE   /want   FALSE   2139150993      mooo2   indeed2
+domain..tld    FALSE   /       FALSE   2139150993      mooo    indeed
 www.loser.com  FALSE   /       FALSE   2139150993      UID     99
+www.fake.come  FALSE   /       FALSE   2022144953      cookiecliente   si
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test506 b/tests/data/test506
index cd1a7dfc2..30f4aa9c0 100644
--- a/tests/data/test506
+++ b/tests/data/test506
@@ -205,14 +205,14 @@ lock:   cookie [Pigs in space]: 86
 unlock: cookie [Pigs in space]: 87
 loaded cookies:
 -----------------
-  .host.foo.com        TRUE    /       FALSE   1896263787      injected        
yes
-  .foo.com     TRUE    /       FALSE   1993463787      test1   overwritten1
-  .host.foo.com        TRUE    /       FALSE   1896263787      test2   two
-  .foo.com     TRUE    /       FALSE   1896263787      test3   three
-  .host.foo.com        TRUE    /       FALSE   2061978987      test4   
overwritten4
-  .host.foo.com        TRUE    /       FALSE   1896263787      test5   five
-  .www.host.foo.com    TRUE    /       FALSE   1993463787      test6   six
   www.host.foo.com     FALSE   /       FALSE   1993463787      test6   six_more
+  .www.host.foo.com    TRUE    /       FALSE   1993463787      test6   six
+  .host.foo.com        TRUE    /       FALSE   1896263787      test5   five
+  .host.foo.com        TRUE    /       FALSE   2061978987      test4   
overwritten4
+  .foo.com     TRUE    /       FALSE   1896263787      test3   three
+  .host.foo.com        TRUE    /       FALSE   1896263787      test2   two
+  .foo.com     TRUE    /       FALSE   1993463787      test1   overwritten1
+  .host.foo.com        TRUE    /       FALSE   1896263787      injected        
yes
 -----------------
 try SHARE_CLEANUP...
 lock:   share  [Pigs in space]: 88
@@ -236,14 +236,14 @@ http://%HOSTIP:%HTTPPORT/506
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-.host.foo.com  TRUE    /       FALSE   1896263787      injected        yes
-.foo.com       TRUE    /       FALSE   1993463787      test1   overwritten1
-.host.foo.com  TRUE    /       FALSE   1896263787      test2   two
-.foo.com       TRUE    /       FALSE   1896263787      test3   three
-.host.foo.com  TRUE    /       FALSE   2061978987      test4   overwritten4
-.host.foo.com  TRUE    /       FALSE   1896263787      test5   five
-.www.host.foo.com      TRUE    /       FALSE   1993463787      test6   six
 www.host.foo.com       FALSE   /       FALSE   1993463787      test6   six_more
+.www.host.foo.com      TRUE    /       FALSE   1993463787      test6   six
+.host.foo.com  TRUE    /       FALSE   1896263787      test5   five
+.host.foo.com  TRUE    /       FALSE   2061978987      test4   overwritten4
+.foo.com       TRUE    /       FALSE   1896263787      test3   three
+.host.foo.com  TRUE    /       FALSE   1896263787      test2   two
+.foo.com       TRUE    /       FALSE   1993463787      test1   overwritten1
+.host.foo.com  TRUE    /       FALSE   1896263787      injected        yes
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test61 b/tests/data/test61
index 74b8f6428..784163fa9 100644
--- a/tests/data/test61
+++ b/tests/data/test61
@@ -65,9 +65,9 @@ Accept: */*
 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-#HttpOnly_.foo.com     TRUE    /we/want/       FALSE   2054030187      test    
yes
-.host.foo.com  TRUE    /we/want/       FALSE   2054030187      test2   yes
 .foo.com       TRUE    /moo    TRUE    0       test3   maybe
+.host.foo.com  TRUE    /we/want/       FALSE   2054030187      test2   yes
+#HttpOnly_.foo.com     TRUE    /we/want/       FALSE   2054030187      test    
yes
 </file>
 </verify>
 </testcase>
diff --git a/tests/data/test8 b/tests/data/test8
index ffc421ab8..2fc190060 100644
--- a/tests/data/test8
+++ b/tests/data/test8
@@ -62,7 +62,7 @@ perl -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only 
works for HOSTIPs endi
 GET /we/want/8 HTTP/1.1
 Host: %HOSTIP:%HTTPPORT
 Accept: */*
-Cookie: cookie=perhaps; name with space=is weird but; trailingspace=removed; 
cookie=yes; foobar=name; blexp=yesyes
+Cookie: name with space=is weird but; trailingspace=removed; cookie=perhaps; 
cookie=yes; foobar=name; blexp=yesyes
 
 </protocol>
 </verify>

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]