Caches NamePlusRecord BER; works well
[yaz-moved-to-github.git] / src / zoom-p.h
index 295893e..37ef8a7 100644 (file)
 #include <yaz/wrbuf.h>
 #include <yaz/zoom.h>
 #include <yaz/srw.h>
+#include <yaz/cookie.h>
 #include <yaz/mutex.h>
+#if HAVE_LIBMEMCACHED_MEMCACHED_H
+#include <libmemcached/memcached.h>
+#endif
 
 #define SHPTR 1
 
@@ -102,10 +106,14 @@ struct ZOOM_connection_p {
     ZOOM_Event m_queue_back;
     zoom_sru_mode sru_mode;
     int no_redirects; /* 0 for no redirects. >0 for number of redirects */
+    yaz_cookies_t cookies;
 
     int log_details;
     int log_api;
     WRBUF saveAPDU_wrbuf;
+#if HAVE_LIBMEMCACHED_MEMCACHED_H
+    memcached_st *mc_st;
+#endif
 };
 
 typedef struct ZOOM_record_cache_p *ZOOM_record_cache;
@@ -134,6 +142,8 @@ struct ZOOM_resultset_p {
     ZOOM_facet_field *facets;
     int num_facets;
     char **facets_names;
+    WRBUF mc_key;
+    int live_set; /* 0=no hit count, 1=cached hit, 2=hits + real set */
 };
 
 struct facet_term_p {
@@ -181,17 +191,7 @@ struct ZOOM_task_p {
             char *syntax;
             char *elementSetName;
             char *schema;
-            int recv_search_fired;
         } search;
-#define ZOOM_TASK_RETRIEVE 2
-        struct {
-            int start;
-            ZOOM_resultset resultset;
-            int count;
-            char *syntax;
-            char *elementSetName;
-            char *schema;
-        } retrieve;
 #define ZOOM_TASK_CONNECT 3
 #define ZOOM_TASK_SCAN 4
         struct {