Updates for yaz/ylog.h
[yazpp-moved-to-github.git] / src / yaz-z-server-sr.cpp
index 9750e16..396757f 100644 (file)
@@ -2,20 +2,12 @@
  * Copyright (c) 2000-2001, Index Data.
  * See the file LICENSE for details.
  * 
- * $Log: yaz-z-server-sr.cpp,v $
- * Revision 1.3  2001-04-25 18:59:30  adam
- * Added referenceId handling for server.
- *
- * Revision 1.2  2001/04/04 14:02:49  adam
- * URSULA / Z-ruth service.
- *
- * Revision 1.1  2001/03/27 15:02:14  adam
- * New server facility scheme.
+ * $Id: yaz-z-server-sr.cpp,v 1.7 2004-11-30 21:10:31 adam Exp $
  *
  */
 
-#include <yaz/log.h>
-#include <yaz++/yaz-z-server.h>
+#include <yaz/ylog.h>
+#include <yaz++/z-server.h>
 
 Z_Records *Yaz_Facility_Retrieval::pack_records (Yaz_Z_Server *s,
                                                 const char *resultSetName,
@@ -39,9 +31,6 @@ Z_Records *Yaz_Facility_Retrieval::pack_records (Yaz_Z_Server *s,
     *pres = Z_PRES_SUCCESS;
     *next = 0;
 
-    yaz_log(LOG_LOG, "Request to pack %d+%d", start, toget);
-    yaz_log(LOG_LOG, "pms=%d, mrs=%d", m_preferredMessageSize,
-           m_maximumRecordSize);
     for (recno = start; reclist->num_records < toget; recno++)
     {
        Z_NamePlusRecord *this_rec =
@@ -72,20 +61,16 @@ Z_Records *Yaz_Facility_Retrieval::pack_records (Yaz_Z_Server *s,
         */
        total_length = odr_total(odr_encode()) - dumped_records;
        this_length = odr_total(odr_encode()) - total_length;
-       yaz_log(LOG_LOG, "  fetched record, len=%d, total=%d",
-               this_length, total_length);
        if (this_length + total_length > m_preferredMessageSize)
        {
            /* record is small enough, really */
            if (this_length <= m_preferredMessageSize)
            {
-               yaz_log(LOG_LOG, "  Dropped last normal-sized record");
                *pres = Z_PRES_PARTIAL_2;
                break;
            }
            if (this_length >= m_maximumRecordSize)
            {   /* too big entirely */
-               yaz_log(LOG_LOG, "Record > maxrcdsz");
                reclist->records[reclist->num_records] = this_rec;
                create_surrogateDiagnostics(odr_encode(), this_rec,
                                            this_rec->databaseName, 17, 0);
@@ -96,10 +81,9 @@ Z_Records *Yaz_Facility_Retrieval::pack_records (Yaz_Z_Server *s,
            }
            else /* record can only be fetched by itself */
            {
-               yaz_log(LOG_LOG, "  Record > prefmsgsz");
                if (toget > 1)
                {
-                   yaz_log(LOG_DEBUG, "  Dropped it");
+                   yaz_log(YLOG_DEBUG, "  Dropped it");
                    reclist->records[reclist->num_records] = this_rec;
                    create_surrogateDiagnostics(odr_encode(), this_rec,
                                                this_rec->databaseName,
@@ -228,7 +212,6 @@ int Yaz_Facility_Retrieval::recv(Yaz_Z_Server *s, Z_APDU *apdu_request)
     switch (apdu_request->which)
     {
     case Z_APDU_searchRequest:
-        yaz_log (LOG_LOG, "got SearchRequest p=%p", this);
        apdu_response = s->create_Z_PDU(Z_APDU_searchResponse);
        s->transfer_referenceId(apdu_request, apdu_response);
        sr_search (apdu_request->u.searchRequest,
@@ -238,10 +221,9 @@ int Yaz_Facility_Retrieval::recv(Yaz_Z_Server *s, Z_APDU *apdu_request)
            fetch_via_piggyback(s, apdu_request->u.searchRequest,
                                apdu_response->u.searchResponse);
        }
-       s->send_Z_PDU(apdu_response);
+       s->send_Z_PDU(apdu_response, 0);
        return 1;
     case Z_APDU_presentRequest:
-        yaz_log (LOG_LOG, "got PresentRequest p=%p", this);
        apdu_response = s->create_Z_PDU(Z_APDU_presentResponse);
        s->transfer_referenceId(apdu_request, apdu_response);
        sr_present (apdu_request->u.presentRequest,
@@ -249,7 +231,7 @@ int Yaz_Facility_Retrieval::recv(Yaz_Z_Server *s, Z_APDU *apdu_request)
        if (!apdu_response->u.presentResponse->records)
            fetch_via_present(s, apdu_request->u.presentRequest,
                              apdu_response->u.presentResponse);
-       s->send_Z_PDU(apdu_response);
+       s->send_Z_PDU(apdu_response, 0);
        return 1;
     }
     return 0;