- if (assoc->print && !z_APDU(assoc->print, &res, 0, 0))
- {
- yaz_log(LOG_WARN, "ODR print error: %s",
- odr_errmsg(odr_geterror(assoc->print)));
- odr_reset(assoc->print);
- }
- if (!z_APDU(assoc->encode, &res, 0, 0))
- {
- yaz_log(LOG_WARN, "ODR error when encoding response: %s",
- odr_errmsg(odr_geterror(assoc->decode)));
- return -1;
- }
- req->response = odr_getbuf(assoc->encode, &req->len_response,
- &req->size_response);
- odr_setbuf(assoc->encode, 0, 0, 0); /* don'txfree if we abort later */
- odr_reset(assoc->encode);
- req->state = REQUEST_IDLE;
- request_enq(&assoc->outgoing, req);
- /* turn the work over to the ir_session handler */
- iochan_setflag(assoc->client_chan, EVENT_OUTPUT);
- assoc->cs_put_mask = EVENT_OUTPUT;
- /* Is there more work to be done? give that to the input handler too */
-#if 1
- if (request_head(&assoc->incoming))
- {
- yaz_log (LOG_DEBUG, "more work to be done");
- iochan_setevent(assoc->client_chan, EVENT_WORK);
- }
-#endif
- return 0;