Use queue for raw show; to solve Bug #1644.
[pazpar2-moved-to-github.git] / src / http.c
index dfc4f38..9a142d7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: http.c,v 1.40 2007-09-26 09:09:15 adam Exp $
+/* $Id: http.c,v 1.41 2007-10-02 12:11:14 adam Exp $
    Copyright (c) 2006-2007, Index Data.
 
 This file is part of Pazpar2.
@@ -68,7 +68,8 @@ static struct http_channel *http_channel_freelist = 0;
 
 struct http_channel_observer_s {
     void *data;
-    void (*destroy)(void *data, struct http_channel *chan);
+    void *data2;
+    http_channel_destroy_t destroy;
     struct http_channel_observer_s *next;
     struct http_channel *chan;
 };
@@ -1227,7 +1228,7 @@ static void http_fire_observers(struct http_channel *c)
     http_channel_observer_t p = c->observers;
     while (p)
     {
-        p->destroy(p->data, c);
+        p->destroy(p->data, c, p->data2);
         p = p->next;
     }
 }
@@ -1248,6 +1249,7 @@ http_channel_observer_t http_add_observer(struct http_channel *c, void *data,
     http_channel_observer_t obs = xmalloc(sizeof(*obs));
     obs->chan = c;
     obs->data = data;
+    obs->data2 = 0;
     obs->destroy= des;
     obs->next = c->observers;
     c->observers = obs;
@@ -1271,6 +1273,12 @@ struct http_channel *http_channel_observer_chan(http_channel_observer_t obs)
     return obs->chan;
 }
 
+void http_observer_set_data2(http_channel_observer_t obs, void *data2)
+{
+    obs->data2 = data2;
+}
+
+
 /*
  * Local variables:
  * c-basic-offset: 4