yaz_solr_decode_response will always return non-NULL PDU if return
value is 0 (success).
int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup)
{
int ret = -1;
int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup)
{
int ret = -1;
#if YAZ_HAVE_XML2
const char *content_buf = hres->content_buf;
int content_len = hres->content_len;
xmlDocPtr doc = xmlParseMemory(content_buf, content_len);
#if YAZ_HAVE_XML2
const char *content_buf = hres->content_buf;
int content_len = hres->content_len;
xmlDocPtr doc = xmlParseMemory(content_buf, content_len);
xmlNodePtr root = xmlDocGetRootElement(doc);
if (root && !strcmp((const char *) root->name, "response"))
{
xmlNodePtr root = xmlDocGetRootElement(doc);
if (root && !strcmp((const char *) root->name, "response"))
{
- ret = 0;
- for (ptr = root->children; ptr && !ret; ptr = ptr->next)
+ for (ptr = root->children; ptr; ptr = ptr->next)
{
if (ptr->type == XML_ELEMENT_NODE &&
!strcmp((const char *) ptr->name, "result"))
{
if (ptr->type == XML_ELEMENT_NODE &&
!strcmp((const char *) ptr->name, "result"))
- if (ret == 0)
- *pdup = pdu;