Index: client_side.c
===================================================================
RCS file: /cvsroot/squid/squid/src/client_side.c,v
retrieving revision 1.762
diff -u -u -r1.762 client_side.c
--- client_side.c	2 Apr 2008 03:25:38 -0000	1.762
+++ client_side.c	7 Apr 2008 05:38:29 -0000
@@ -167,31 +167,6 @@
 static StoreEntry *clientCreateStoreEntry(clientHttpRequest *, method_t, request_flags);
 static inline int clientNatLookup(ConnStateData * conn);
 
-/* Temporary here while restructuring stuff */
-static void
-storeClientCopyHeadersCB(void *data, mem_node_ref nr, ssize_t size)
-{
-    clientHttpRequest *http = data;
-    assert(http->header_callback);
-    assert(http->header_entry);
-    stmemNodeUnref(&nr);
-    if (!http->header_entry)
-	return;
-    if (size < 0 || !memHaveHeaders(http->header_entry->mem_obj)) {
-	http->header_callback(data, NULL);
-	return;
-    }
-    http->header_callback(data, http->header_entry->mem_obj->reply);
-}
-void
-storeClientCopyHeaders(store_client * sc, StoreEntry * e, STHCB * callback, void *callback_data)
-{
-    clientHttpRequest *http = callback_data;
-    http->header_callback = callback;
-    http->header_entry = e;
-    storeClientRef(http->sc, e, 0, 0, SM_PAGE_SIZE, storeClientCopyHeadersCB, http);
-}
-
 #if USE_IDENT
 static void
 clientIdentDone(const char *ident, void *data)
Index: store_client.c
===================================================================
RCS file: /cvsroot/squid/squid/src/store_client.c,v
retrieving revision 1.136
diff -u -u -r1.136 store_client.c
--- store_client.c	6 Apr 2008 19:57:32 -0000	1.136
+++ store_client.c	7 Apr 2008 05:38:29 -0000
@@ -739,3 +739,26 @@
     statCounter.aborted_requests++;
     storeAbort(entry);
 }
+
+static void
+storeClientCopyHeadersCB(void *data, mem_node_ref nr, ssize_t size)
+{   
+    store_client *sc = data;
+    assert(sc->header_cbdata);
+    assert(sc->header_callback);
+    stmemNodeUnref(&nr);
+    /* XXX should cbdata lock/unlock the cbdata? */
+    if (size < 0 || !memHaveHeaders(sc->entry->mem_obj)) {
+        sc->header_callback(sc->header_cbdata, NULL);
+        return;
+    }
+    sc->header_callback(sc->header_cbdata, sc->entry->mem_obj->reply);
+}
+        
+void  
+storeClientCopyHeaders(store_client * sc, StoreEntry * e, STHCB * callback, void *callback_data)
+{
+    sc->header_callback = callback;
+    sc->header_cbdata = callback_data;
+    storeClientRef(sc, e, 0, 0, SM_PAGE_SIZE, storeClientCopyHeadersCB, sc);
+}
Index: structs.h
===================================================================
RCS file: /cvsroot/squid/squid/src/structs.h,v
retrieving revision 1.549
diff -u -u -r1.549 structs.h
--- structs.h	2 Apr 2008 03:25:38 -0000	1.549
+++ structs.h	7 Apr 2008 05:38:30 -0000
@@ -1273,8 +1273,6 @@
     squid_off_t delayMaxBodySize;
     ushort delayAssignedPool;
     mem_node_ref nr;
-    STHCB *header_callback;	/* Temporarily here for storeClientCopyHeaders */
-    StoreEntry *header_entry;	/* Temporarily here for storeClientCopyHeaders */
     int is_modified;
 };
 
@@ -1680,6 +1678,8 @@
     mem_node_ref node_ref;
     STNCB *new_callback;
     void *callback_data;
+    STHCB *header_callback;
+    void *header_cbdata;
     StoreEntry *entry;		/* ptr to the parent StoreEntry, argh! */
     storeIOState *swapin_sio;
     struct {

