From: Adam Dickmeiss Date: Thu, 12 Aug 2010 13:22:16 +0000 (+0200) Subject: Rename SOLR HTTP response function X-Git-Tag: v4.1.0~40^2~5 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=96e65728eefb6d7efef6e2f74a3b0d64f92b3c23;p=yaz-moved-to-github.git Rename SOLR HTTP response function From yaz_solr_decode to yaz_solr_decode_response; it only deals with HTTP response decoding. --- diff --git a/client/client.c b/client/client.c index d9a98f8..d4bd50e 100644 --- a/client/client.c +++ b/client/client.c @@ -4369,7 +4369,7 @@ static void http_response(Z_HTTP_Response *hres) { Z_SRW_PDU *sr = 0; ODR o = odr_createmem(ODR_DECODE); - ret = yaz_solr_decode(o, hres, &sr); + ret = yaz_solr_decode_response(o, hres, &sr); if (ret == 0 && sr->which == Z_SRW_searchRetrieve_response) handle_srw_response(sr->u.response); diff --git a/include/yaz/srw.h b/include/yaz/srw.h index f630a93..981097a 100644 --- a/include/yaz/srw.h +++ b/include/yaz/srw.h @@ -266,12 +266,21 @@ YAZ_EXPORT void yaz_decode_uri_component(char *dst, const char *uri, YAZ_EXPORT int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, Z_SOAP **soap_package, ODR decode, char **charset); + YAZ_EXPORT int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, Z_SOAP **soap_package, ODR decode, char **charset, Z_SRW_diagnostic **, int *num_diagnostic); -YAZ_EXPORT int yaz_solr_decode(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup); +/** \brief decode SOLR response (HTTP) + \param o ODR for result + \param hres HTTP response to be decoded + \param pdup SRW response pointer (set if successful) + \retval -1 fail + \retval 0 OK +*/ +YAZ_EXPORT int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, + Z_SRW_PDU **pdup); YAZ_EXPORT void yaz_add_srw_diagnostic(ODR o, Z_SRW_diagnostic **d, diff --git a/src/solr.c b/src/solr.c index 1fa0d38..1783440 100644 --- a/src/solr.c +++ b/src/solr.c @@ -20,7 +20,7 @@ #include #endif -int yaz_solr_decode(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup) +int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup) { #if YAZ_HAVE_XML2 const char *content_buf = hres->content_buf; diff --git a/src/zoom-sru.c b/src/zoom-sru.c index 144f025..0ff4e3c 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -388,7 +388,7 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres, else if (c->sru_mode == zoom_sru_solr) { Z_SRW_PDU *sr; - ret = yaz_solr_decode(c->odr_in, hres, &sr); + ret = yaz_solr_decode_response(c->odr_in, hres, &sr); if (ret == 0) if (sr->which == Z_SRW_searchRetrieve_response) *cret = handle_srw_response(c, sr->u.response);