X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fseshigh.c;h=006c3fae903675cc5c89090d726e5e5a75887c14;hp=cdc9fdc7e7eaedaeef5bfaba007c59b1b971706b;hb=80fee38926477efd73c739731c5670d59c5d1bf7;hpb=d758b64a40725394de0b05bdcf108948bf13ee49 diff --git a/src/seshigh.c b/src/seshigh.c index cdc9fdc..006c3fa 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -127,6 +127,16 @@ static void wr_diag(WRBUF w, int error, const char *addinfo) wrbuf_puts(w, " "); } +static int odr_int_to_int(Odr_int v) +{ + if (v >= INT_MAX) + return INT_MAX; + else if (v <= INT_MIN) + return INT_MIN; + else + return (int) v; +} + /* * Create and initialize a new association-handle. * channel : iochannel for the current line. @@ -836,15 +846,6 @@ static int ccl2pqf(ODR odr, const Odr_oct *ccl, CCL_bibset bibset, return 0; } -static int odr_int_to_int(Odr_int v) -{ - if (v >= INT_MAX) - return INT_MAX; - else if (v <= INT_MIN) - return INT_MIN; - else return v; -} - static void srw_bend_search(association *assoc, request *req, Z_SRW_PDU *sr, Z_SRW_PDU *res, @@ -2289,10 +2290,10 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) yaz_log(log_requestdetail, "Negotiated to v%d: %s", assoc->version, options); if (*req->maximumRecordSize < assoc->maximumRecordSize) - assoc->maximumRecordSize = *req->maximumRecordSize; + assoc->maximumRecordSize = odr_int_to_int(*req->maximumRecordSize); if (*req->preferredMessageSize < assoc->preferredMessageSize) - assoc->preferredMessageSize = *req->preferredMessageSize; + assoc->preferredMessageSize = odr_int_to_int(*req->preferredMessageSize); resp->preferredMessageSize = odr_intdup(assoc->encode, assoc->preferredMessageSize);