]> granicus.if.org Git - curl/commitdiff
This should no longer send empty cookies to the server
authorDaniel Stenberg <daniel@haxx.se>
Thu, 10 Feb 2000 23:15:33 +0000 (23:15 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 10 Feb 2000 23:15:33 +0000 (23:15 +0000)
lib/http.c

index 38b07b6ad8369fa513c952d2c602f69847c17015..c37318d8f02ce21c99fe334f975f7dfed8a8f4c9 100644 (file)
@@ -229,13 +229,15 @@ UrgError http(struct UrlData *data, char *ppath, char *host, long *bytecount)
       int count=0;
       /* now loop through all cookies that matched */
       while(co) {
-        if(0 == count) {
+        if(co->value && strlen(co->value)) {
+          if(0 == count) {
+            sendf(data->firstsocket, data,
+                  "Cookie: ");
+          }
+          count++;
           sendf(data->firstsocket, data,
-                "Cookie: ");
+                "%s=%s;", co->name, co->value);
         }
-        count++;
-        sendf(data->firstsocket, data,
-              "%s=%s;", co->name, co->value);
         co = co->next; /* next cookie please */
       }
       if(count) {