From: Adam Dickmeiss Date: Fri, 8 Feb 2013 12:40:13 +0000 (+0100) Subject: Fix lock problem with command=bytarget&block=1 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0aef52e59b51c698a6025bdd82df77ff4b2e4390;p=pazpar2-moved-to-github.git Fix lock problem with command=bytarget&block=1 --- diff --git a/src/http_command.c b/src/http_command.c index cf7ab9b..2e8a6ea 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -825,7 +825,9 @@ static void cmd_bytarget(struct http_channel *c) return; } } + session_enter_ro(s->psession, "cmd_bytarget"); bytarget_response(c, s, status_message); + session_leave_ro(s->psession, "cmd_bytarget"); release_session(c, s); } diff --git a/src/session.c b/src/session.c index e923abf..a09f7d8 100644 --- a/src/session.c +++ b/src/session.c @@ -1064,9 +1064,7 @@ static struct hitsbytarget *hitsbytarget_nb(struct session *se, struct hitsbytarget *get_hitsbytarget(struct session *se, int *count, NMEM nmem) { struct hitsbytarget *p; - session_enter_ro(se, "get_hitsbytarget"); p = hitsbytarget_nb(se, count, nmem); - session_leave_ro(se, "get_hitsbytarget"); return p; } diff --git a/test/test_http.urls b/test/test_http.urls index e51c15e..ae62177 100644 --- a/test/test_http.urls +++ b/test/test_http.urls @@ -68,7 +68,7 @@ http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=aut http://localhost:9763/search.pz2?session=9&command=bytarget http://localhost:9763/search.pz2?session=9&command=show http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author -http://localhost:9763/search.pz2?session=9&command=bytarget +http://localhost:9763/search.pz2?session=9&command=bytarget&block=1 http://localhost:9763/search.pz2?session=9&command=show http://localhost:9763/search.pz2?session=9&command=search&query=computer&limit=Mysubject%3DRailroads http://localhost:9763/search.pz2?session=9&command=show&block=1