X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsession.h;h=197e01b7282207c54da548f4625dc3438d83d582;hb=7d4ba557fe01543f0a3aac7a1a738a426d0a1eff;hp=6a4bf315cc86a635348aeb7df2c92c08a2b9c8e9;hpb=bd0842d306cd7004c22d8df9fd809689b17896c8;p=pazpar2-moved-to-github.git diff --git a/src/session.h b/src/session.h index 6a4bf31..197e01b 100644 --- a/src/session.h +++ b/src/session.h @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) 2006-2013 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -25,9 +25,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include "facet_limit.h" #include "termlists.h" #include "reclists.h" #include "http.h" +#include "ppmutex.h" struct record; struct client; @@ -116,9 +118,10 @@ struct session { int number_of_warnings_unknown_elements; int number_of_warnings_unknown_metadata; normalize_cache_t normalize_cache; - YAZ_MUTEX session_mutex; + Pazpar2_lock_rdwr lock; unsigned session_id; int settings_modified; + facet_limits_t facet_limits; struct reclist_sortparms *sorted_results; }; @@ -140,6 +143,7 @@ struct hitsbytarget { Odr_int hits; Odr_int approximation; int diagnostic; + const char *message; const char *addinfo; int records; int filtered; @@ -150,8 +154,8 @@ struct hitsbytarget { }; struct hitsbytarget *get_hitsbytarget(struct session *s, int *count, NMEM nmem); -struct session *new_session(NMEM nmem, struct conf_service *service, - unsigned session_id); +struct session *session_create(NMEM nmem, struct conf_service *service, + unsigned session_id); void session_destroy(struct session *s); void session_init_databases(struct session *s); void statistics(struct session *s, struct statistics *stat); @@ -184,8 +188,16 @@ int ingest_record(struct client *cl, const char *rec, int record_no, NMEM nmem); void session_alert_watch(struct session *s, int what); void add_facet(struct session *s, const char *type, const char *value, int count); +int session_check_cluster_limit(struct session *se, struct record_cluster *rec); void perform_termlist(struct http_channel *c, struct session *se, const char *name, int num, int version); + +void session_enter_ro(struct session *s, const char *caller); +void session_leave_ro(struct session *s, const char *caller); + +void session_enter_rw(struct session *s, const char *caller); +void session_leave_rw(struct session *s, const char *caller); + void session_log(struct session *s, int level, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4)))