X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fseshigh.c;h=15535b1bf7c032dfb90198c5a5c5d6aa791ffbfc;hb=5107068a489f5ea7923841d855a2145b0db94de1;hp=aebcdc0173d403a856513502d806c562a239625c;hpb=6b76baf0fb5d0d437caedd8076f77f372d775758;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index aebcdc0..15535b1 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -377,7 +377,7 @@ void ir_session(IOCHAN h, int event) { if (assoc->state != ASSOC_UP) { - yaz_log(YLOG_DEBUG, "Final timeout - closing connection."); + yaz_log(log_session, "Timeout. Closing connection"); /* do we need to lod this at all */ cs_close(conn); destroy_association(assoc); @@ -385,8 +385,7 @@ void ir_session(IOCHAN h, int event) } else { - yaz_log(log_sessiondetail, - "Session idle too long. Sending close."); + yaz_log(log_sessiondetail, "Timeout. Sending Z39.50 Close"); do_close(assoc, Z_Close_lackOfActivity, 0); } return; @@ -1691,6 +1690,7 @@ static void process_http_request(association *assoc, request *req) int num_diagnostic = 0; const char *host = z_HTTP_header_lookup(hreq->headers, "Host"); + yaz_log(log_request, "%s %s HTTP/%s", hreq->method, hreq->path, hreq->version); if (!control_association(assoc, host, 0)) { p = z_get_HTTP_Response(o, 404); @@ -2364,6 +2364,9 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) binitres->errstring); *resp->result = 0; } + else + assoc->state = ASSOC_UP; + if (log_request) { if (!req->idAuthentication) @@ -2458,9 +2461,9 @@ static Z_NamePlusRecord *surrogatediagrec(association *assoc, return zget_surrogateDiagRec(assoc->encode, dbname, error, addinfo); } -static Z_Records *pack_records(association *a, char *setname, odr_int_t start, - odr_int_t *num, Z_RecordComposition *comp, - odr_int_t *next, odr_int_t *pres, +static Z_Records *pack_records(association *a, char *setname, Odr_int start, + Odr_int *num, Z_RecordComposition *comp, + Odr_int *next, Odr_int *pres, Z_ReferenceId *referenceId, Odr_oid *oid, int *errcode) { @@ -2704,9 +2707,9 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb, Z_APDU *apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu)); Z_SearchResponse *resp = (Z_SearchResponse *) odr_malloc(assoc->encode, sizeof(*resp)); - odr_int_t *nulint = odr_intdup(assoc->encode, 0); - odr_int_t *next = odr_intdup(assoc->encode, 0); - odr_int_t *none = odr_intdup(assoc->encode, Z_SearchResponse_none); + Odr_int *nulint = odr_intdup(assoc->encode, 0); + Odr_int *next = odr_intdup(assoc->encode, 0); + Odr_int *none = odr_intdup(assoc->encode, Z_SearchResponse_none); int returnedrecs = 0; apdu->which = Z_APDU_searchResponse; @@ -2733,7 +2736,7 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb, else { bool_t *sr = odr_booldup(assoc->encode, 1); - odr_int_t *toget = odr_intdup(assoc->encode, 0); + Odr_int *toget = odr_intdup(assoc->encode, 0); Z_RecordComposition comp, *compp = 0; yaz_log(log_requestdetail, "resultCount: " ODR_INT_PRINTF, bsrt->hits); @@ -2762,7 +2765,7 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb, if (*toget && !resp->records) { - odr_int_t *presst = odr_intdup(assoc->encode, 0); + Odr_int *presst = odr_intdup(assoc->encode, 0); /* Call bend_present if defined */ if (assoc->init->bend_present) { @@ -2872,8 +2875,8 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb, Z_PresentRequest *req = reqb->apdu_request->u.presentRequest; Z_APDU *apdu; Z_PresentResponse *resp; - odr_int_t *next; - odr_int_t *num; + Odr_int *next; + Odr_int *num; int errcode = 0; const char *errstring = 0; @@ -2966,8 +2969,8 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) Z_APDU *apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu)); Z_ScanResponse *res = (Z_ScanResponse *) odr_malloc(assoc->encode, sizeof(*res)); - odr_int_t *scanStatus = odr_intdup(assoc->encode, Z_Scan_failure); - odr_int_t *numberOfEntriesReturned = odr_intdup(assoc->encode, 0); + Odr_int *scanStatus = odr_intdup(assoc->encode, Z_Scan_failure); + Odr_int *numberOfEntriesReturned = odr_intdup(assoc->encode, 0); Z_ListEntries *ents = (Z_ListEntries *) odr_malloc(assoc->encode, sizeof(*ents)); Z_DiagRecs *diagrecs_p = NULL; @@ -3268,7 +3271,7 @@ static Z_APDU *process_deleteRequest(association *assoc, request *reqb, bdrr->statuses = 0; if (bdrr->num_setnames > 0) { - bdrr->statuses = (odr_int_t*) + bdrr->statuses = (Odr_int*) odr_malloc(assoc->encode, sizeof(*bdrr->statuses) * bdrr->num_setnames); for (i = 0; i < bdrr->num_setnames; i++)