From: Adam Dickmeiss Date: Tue, 4 Feb 2014 13:40:55 +0000 (+0100) Subject: ZOOM_resultset_record_immedate never makes RECV_RECORD event X-Git-Tag: v5.0.13~18 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=d1b6ed4a27c255041e3d719e4b05ab476c337bbf;p=yaz-moved-to-github.git ZOOM_resultset_record_immedate never makes RECV_RECORD event Fixes test_http_86 for Pazpar2. --- diff --git a/src/zoom-c.c b/src/zoom-c.c index 3d38105..b1f5aca 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -1128,7 +1128,7 @@ ZOOM_API(ZOOM_record) const char *schema = ZOOM_options_get(s->options, "schema"); - return ZOOM_record_cache_lookup(s, pos, syntax, elementSetName, schema); + return ZOOM_record_cache_lookup_i(s, pos, syntax, elementSetName, schema); } ZOOM_API(ZOOM_record) diff --git a/src/zoom-p.h b/src/zoom-p.h index 4372ece..3cb9b80 100644 --- a/src/zoom-p.h +++ b/src/zoom-p.h @@ -288,7 +288,10 @@ Z_NamePlusRecord *ZOOM_memcached_lookup(ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema); - +ZOOM_record ZOOM_record_cache_lookup_i(ZOOM_resultset r, int pos, + const char *syntax, + const char *elementSetName, + const char *schema); void ZOOM_handle_facet_result(ZOOM_connection c, ZOOM_resultset r, Z_OtherInformation *o); void ZOOM_handle_search_result(ZOOM_connection c, ZOOM_resultset resultset, diff --git a/src/zoom-record-cache.c b/src/zoom-record-cache.c index fe1aeec..957e8f9 100644 --- a/src/zoom-record-cache.c +++ b/src/zoom-record-cache.c @@ -131,31 +131,43 @@ void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr, ZOOM_memcached_add(r, npr, pos, syntax, elementSetName, schema, diag); } -ZOOM_record ZOOM_record_cache_lookup(ZOOM_resultset r, int pos, - const char *syntax, - const char *elementSetName, - const char *schema) +ZOOM_record ZOOM_record_cache_lookup_i(ZOOM_resultset r, int pos, + const char *syntax, + const char *elementSetName, + const char *schema) { ZOOM_record_cache rc; - Z_NamePlusRecord *npr; for (rc = r->record_hash[record_hash(pos)]; rc; rc = rc->next) { if (pos == rc->pos) { - ZOOM_Event event; if (yaz_strcmp_null(schema, rc->schema)) continue; if (yaz_strcmp_null(elementSetName,rc->elementSetName)) continue; if (yaz_strcmp_null(syntax, rc->syntax)) continue; - event = ZOOM_Event_create(ZOOM_EVENT_RECV_RECORD); - ZOOM_connection_put_event(r->connection, event); - return &rc->rec; } } + return 0; +} + +ZOOM_record ZOOM_record_cache_lookup(ZOOM_resultset r, int pos, + const char *syntax, + const char *elementSetName, + const char *schema) +{ + Z_NamePlusRecord *npr; + ZOOM_record rec = ZOOM_record_cache_lookup_i(r, pos, syntax, + elementSetName, schema); + if (rec) + { + ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_RECV_RECORD); + ZOOM_connection_put_event(r->connection, event); + return rec; + } npr = ZOOM_memcached_lookup(r, pos, syntax, elementSetName, schema); if (npr) return record_cache_add(r, npr, pos, syntax, elementSetName,