projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d758b64
)
More odr_int casts
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 19 Jan 2010 12:54:54 +0000
(13:54 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 19 Jan 2010 12:54:54 +0000
(13:54 +0100)
src/seshigh.c
patch
|
blob
|
history
diff --git
a/src/seshigh.c
b/src/seshigh.c
index
cdc9fdc
..
006c3fa
100644
(file)
--- 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, " ");
}
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.
/*
* 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;
}
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,
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)
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)
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);
resp->preferredMessageSize =
odr_intdup(assoc->encode, assoc->preferredMessageSize);