Enabling rsprox. Tests OK
[idzebra-moved-to-github.git] / index / zserver.c
index b0f2be7..3ba03d9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zserver.c,v 1.113 2004-01-22 11:27:21 adam Exp $
+/* $Id: zserver.c,v 1.115 2004-05-05 16:22:18 mike Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -79,6 +79,7 @@ bend_initresult *bend_init (bend_initrequest *q)
        r->errcode = 1;
        return r;
     }
+    r->handle = zh;
     if (q->auth)
     {
        if (q->auth->which == Z_IdAuthentication_open)
@@ -93,15 +94,20 @@ bend_initresult *bend_init (bend_initrequest *q)
            }
            xfree (openpass);
        }
+       else if (q->auth->which == Z_IdAuthentication_idPass)
+       {
+           Z_IdPass *idPass = q->auth->u.idPass;
+
+           user = idPass->userId;
+           passwd = idPass->password;
+       }
     }
     if (zebra_auth (zh, user, passwd))
     {
        r->errcode = 222;
        r->errstring = user;
-       zebra_close (zh);
        return r;
     }
-    r->handle = zh;
     if (q->charneg_request) /* characater set and langauge negotiation? */
     {
         char **charsets = 0;
@@ -323,6 +329,11 @@ static int bend_scan (void *handle, bend_scan_rr *r)
         zebra_result (zh, &r->errcode, &r->errstring);
         return 0;
     }
+    if (r->step_size != 0 && *r->step_size != 0) {
+       r->errcode = 205; /* "Only zero step size supported for Scan" */
+       r->errstring = 0;
+        return 0;
+    }
     r->entries = (struct scan_entry *)
        odr_malloc (r->stream, sizeof(*r->entries) * r->num_entries);
     zebra_scan (zh, r->stream, r->term,