GFS: Use zget_APDU rather than zget_Close
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 19 Jan 2010 08:56:16 +0000 (09:56 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 19 Jan 2010 08:56:24 +0000 (09:56 +0100)
Use zget_APDU rather than zget_Close.. Because zget_Close should
not be public and because using zget_APDU is shorter.

src/seshigh.c

index 7f9b7cb..594b21c 100644 (file)
@@ -222,8 +222,8 @@ void destroy_association(association *h)
 static void do_close_req(association *a, int reason, char *message,
                          request *req)
 {
-    Z_APDU apdu;
-    Z_Close *cls = zget_Close(a->encode);
+    Z_APDU *apdu = zget_APDU(a->encode, Z_APDU_close);
+    Z_Close *cls = apdu->u.close;
     
     /* Purge request queue */
     while (request_deq(&a->incoming));
@@ -232,11 +232,9 @@ static void do_close_req(association *a, int reason, char *message,
     {
         yaz_log(log_requestdetail, "Sending Close PDU, reason=%d, message=%s",
             reason, message ? message : "none");
-        apdu.which = Z_APDU_close;
-        apdu.u.close = cls;
         *cls->closeReason = reason;
         cls->diagnosticInformation = message;
-        process_z_response(a, req, &apdu);
+        process_z_response(a, req, apdu);
         iochan_settimeout(a->client_chan, 20);
     }
     else