Fixed bug #2021.. location now holds all brief elements.
[pazpar2-moved-to-github.git] / src / client.c
index d67712e..0a8860d 100644 (file)
@@ -34,14 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NETDB_H
-#include <netdb.h>
-#endif
 #include <signal.h>
-#include <ctype.h>
 #include <assert.h>
 
 #include <yaz/marcdisp.h>
@@ -65,10 +58,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <yaz/timing.h>
 #endif
 
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
 #include "pazpar2.h"
 
 #include "client.h"
@@ -84,8 +73,6 @@ struct client {
     char *cqlquery; // used for SRU targets only
     int hits;
     int record_offset;
-    int setno;
-    int requestid;            // ID of current outstanding request
     int diagnostic;
     enum client_state state;
     struct show_raw *show_raw;
@@ -106,14 +93,11 @@ struct show_raw {
 
 static const char *client_states[] = {
     "Client_Connecting",
-    "Client_Connected",
     "Client_Idle",
     "Client_Working",
     "Client_Error",
     "Client_Failed",
-    "Client_Disconnected",
-    "Client_Stopped",
-    "Client_Continue"
+    "Client_Disconnected"
 };
 
 static struct client *client_freelist = 0;
@@ -169,12 +153,6 @@ const char *client_get_pquery(struct client *cl)
     return cl->pquery;
 }
 
-void client_set_requestid(struct client *cl, int id)
-{
-    cl->requestid = id;
-}
-
-
 static void client_send_raw_present(struct client *cl);
 
 int client_show_raw_begin(struct client *cl, int position,
@@ -351,6 +329,7 @@ void client_search_response(struct client *cl)
     }
     else
     {
+        cl->record_offset = 0;
         cl->hits = ZOOM_resultset_size(resultset);
         se->total_hits += cl->hits;
     }
@@ -505,8 +484,6 @@ struct client *client_create(void)
     r->session = 0;
     r->hits = 0;
     r->record_offset = 0;
-    r->setno = 0;
-    r->requestid = -1;
     r->diagnostic = 0;
     r->state = Client_Disconnected;
     r->show_raw = 0;
@@ -665,8 +642,7 @@ void client_set_session(struct client *cl, struct session *se)
 
 int client_is_active(struct client *cl)
 {
-    if (cl->connection && (cl->state == Client_Continue ||
-                           cl->state == Client_Connecting ||
+    if (cl->connection && (cl->state == Client_Connecting ||
                            cl->state == Client_Working))
         return 1;
     return 0;