From 47468fed198c86bb88662873264bb6f432f101bf Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 22 Aug 2012 11:26:22 +0200 Subject: [PATCH] Comment on clear set. Think the parameter should be removed, since we cannot decide this from outside the session --- src/session.c | 7 +++++-- src/session.h | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/session.c b/src/session.c index f85a03e..0d463d6 100644 --- a/src/session.c +++ b/src/session.c @@ -640,8 +640,7 @@ static void session_clear_set(struct session *se, se->reclist = reclist_create(se->nmem); } -void session_sort(struct session *se, const char *field, int increasing, - int clear_set) +void session_sort(struct session *se, const char *field, int increasing, int clear_set) { struct session_sorted_results *sr; struct client_list *l; @@ -649,6 +648,10 @@ void session_sort(struct session *se, const char *field, int increasing, session_enter(se); yaz_log(YLOG_LOG, "session_sort field=%s", field); + // TODO In order for this to work, clear_set may only be true on first call. Every following (poll) may not. + // I do not think we can decide this from the outside of the session. + // The logic should be when we change to/away from a native sort order, + // it should cleared on the first call if (clear_set) { session_clear_set(se, field, increasing); diff --git a/src/session.h b/src/session.h index 5cf1fc1..b6b3ca2 100644 --- a/src/session.h +++ b/src/session.h @@ -156,8 +156,7 @@ void session_destroy(struct session *s); void session_init_databases(struct session *s); void statistics(struct session *s, struct statistics *stat); -void session_sort(struct session *se, const char *field, int increasing, - int clear_set); +void session_sort(struct session *se, const char *field, int increasing, int clear_set); enum pazpar2_error_code session_search(struct session *s, const char *query, const char *startrecs, -- 1.7.10.4