Author: adrian.chadd
Date: Mon Feb  2 12:12:04 2009
New Revision: 13792

Modified:
    branches/LUSCA_HEAD/src/client_side.c
    branches/LUSCA_HEAD/src/store.c

Log:
strBuf() -> stringDupToC(). Again, fixing the storeAddVary() routine and  
the vary code
itself to use String instead of C strings is the correct longer term fix.



Modified: branches/LUSCA_HEAD/src/client_side.c
==============================================================================
--- branches/LUSCA_HEAD/src/client_side.c       (original)
+++ branches/LUSCA_HEAD/src/client_side.c       Mon Feb  2 12:12:04 2009
@@ -630,7 +630,10 @@
                vary = httpMakeVaryMark(request, rep);

            if (etag && vary) {
-               storeAddVary(url, entry->mem_obj->method, NULL,  
httpHeaderGetStr(&rep->header, HDR_ETAG), request->vary_hdr,  
request->vary_headers, strBuf(request->vary_encoding));
+               char *str;
+               str = stringDupToC(&request->vary_encoding);
+               storeAddVary(url, entry->mem_obj->method, NULL,  
httpHeaderGetStr(&rep->header, HDR_ETAG), request->vary_hdr,  
request->vary_headers, str);
+               safe_free(str);
            }
        }
        clientHandleETagMiss(http);

Modified: branches/LUSCA_HEAD/src/store.c
==============================================================================
--- branches/LUSCA_HEAD/src/store.c     (original)
+++ branches/LUSCA_HEAD/src/store.c     Mon Feb  2 12:12:04 2009
@@ -1089,6 +1089,7 @@
      StoreEntry *e2 = NULL;
      const cache_key *newkey;
      MemObject *mem = e->mem_obj;
+    const char *str = NULL;
      if (e->hash.key && !EBIT_TEST(e->flags, KEY_PRIVATE)) {
        if (EBIT_TEST(e->flags, KEY_EARLY_PUBLIC)) {
            EBIT_CLR(e->flags, KEY_EARLY_PUBLIC);
@@ -1154,7 +1155,9 @@
                strListAddStr(&vary, strBuf2(varyhdr), strLen2(varyhdr), ',');
            stringClean(&varyhdr);
  #endif
-           storeAddVary(mem->url, mem->method, newkey,  
httpHeaderGetStr(&mem->reply->header, HDR_ETAG), strBuf(vary),  
mem->vary_headers, mem->vary_encoding);
+           str = stringDupToC(&vary);
+           storeAddVary(mem->url, mem->method, newkey,  
httpHeaderGetStr(&mem->reply->header, HDR_ETAG), str, mem->vary_headers,  
mem->vary_encoding);
+           safe_free(str);
            stringClean(&vary);
        }
      } else {

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to