z_HTTP_header_add_basic_auth(c->odr_out, &gdu->u.HTTP_Request->headers,
c->user, c->password);
}
- if (!z_GDU(c->odr_out, &gdu, 0, 0))
+ return ZOOM_send_GDU(c, gdu);
+}
+
+zoom_ret ZOOM_send_GDU(ZOOM_connection c, Z_GDU *gdu)
+{
+ ZOOM_Event event;
+
+ int r = z_GDU(c->odr_out, &gdu, 0, 0);
+ if (!r)
return zoom_complete;
if (c->odr_print)
z_GDU(c->odr_print, &gdu, 0, 0);
if (c->odr_save)
z_GDU(c->odr_save, &gdu, 0, 0);
c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0);
-
odr_reset(c->odr_out);
+
+ event = ZOOM_Event_create(ZOOM_EVENT_SEND_APDU);
+ ZOOM_connection_put_event(c, event);
+
return ZOOM_send_buf(c);
}
ZOOM_Event ZOOM_connection_get_event(ZOOM_connection c);
void ZOOM_connection_remove_events(ZOOM_connection c);
void ZOOM_Event_destroy(ZOOM_Event event);
+zoom_ret ZOOM_send_GDU(ZOOM_connection c, Z_GDU *gdu);
/*
* Local variables:
static zoom_ret send_srw(ZOOM_connection c, Z_SRW_PDU *sr)
{
Z_GDU *gdu;
- ZOOM_Event event;
const char *database = ZOOM_options_get(c->options, "databaseName");
gdu = z_get_HTTP_Request_uri(c->odr_out, c->host_port,
{
yaz_solr_encode_request(gdu->u.HTTP_Request, sr, c->odr_out, c->charset);
}
- if (!z_GDU(c->odr_out, &gdu, 0, 0))
- return zoom_complete;
- if (c->odr_print)
- z_GDU(c->odr_print, &gdu, 0, 0);
- if (c->odr_save)
- z_GDU(c->odr_save, &gdu, 0, 0);
- c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0);
-
- event = ZOOM_Event_create(ZOOM_EVENT_SEND_APDU);
- ZOOM_connection_put_event(c, event);
- odr_reset(c->odr_out);
- return ZOOM_send_buf(c);
+ return ZOOM_send_GDU(c, gdu);
}
#endif
}
}
-
static void handle_Z3950_records(ZOOM_connection c, Z_Records *sr,
int present_phase);