Fix lock problem with command=bytarget&block=1
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 8 Feb 2013 12:40:13 +0000 (13:40 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 8 Feb 2013 12:40:13 +0000 (13:40 +0100)
src/http_command.c
src/session.c
test/test_http.urls

index cf7ab9b..2e8a6ea 100644 (file)
@@ -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);
 }
 
index e923abf..a09f7d8 100644 (file)
@@ -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;
 }
 
index e51c15e..ae62177 100644 (file)
@@ -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