X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fhttp.c;h=9a142d777f40bab7e01ff7d8136ce5fe4ddc5c16;hb=56a55ffd1562165febc1a2a66d0c2a95e966d540;hp=dfc4f38b8507989e597b7de6c9cb4049a5d95dab;hpb=22fe11dc47be6b8a98851d6ff077f1a1d492f35c;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index dfc4f38..9a142d7 100644 --- a/src/http.c +++ b/src/http.c @@ -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