X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=SimpleServer.xs;h=788b92941cdd0049315bc66fe6c8b0290bf66231;hb=2838187cf5b3eb95352f68a9709929a2b42019dc;hp=dfa4bf9f4abb4ae7a9a396e2fc92afa6aa12f39e;hpb=895c753fdac64b0d288a7edf5cab1b816e92c6ee;p=simpleserver-moved-to-github.git diff --git a/SimpleServer.xs b/SimpleServer.xs index dfa4bf9..788b929 100644 --- a/SimpleServer.xs +++ b/SimpleServer.xs @@ -1,5 +1,5 @@ /* - * $Id: SimpleServer.xs,v 1.76 2007-08-20 21:27:50 mike Exp $ + * $Id: SimpleServer.xs,v 1.79 2007-09-10 14:50:31 mike Exp $ * ---------------------------------------------------------------------- * * Copyright (c) 2000-2004, Index Data. @@ -424,9 +424,10 @@ static SV *apt2perl(Z_AttributesPlusTerm *at) setMember(hv2, "attributeValue", newSViv(*elem->value.numeric)); } else { - assert(elem->which == Z_AttributeValue_complex); - Z_ComplexAttribute *c = elem->value.complex; + Z_ComplexAttribute *c; Z_StringOrNumeric *son; + assert(elem->which == Z_AttributeValue_complex); + c = elem->value.complex; /* We ignore semantic actions and multiple values */ assert(c->num_list > 0); son = c->list[0]; @@ -966,6 +967,8 @@ int bend_fetch(void *handle, bend_fetch_rr *rr) else { rr->errcode = 26; + rr->errstring = odr_strdup(rr->stream, "non-generic 'simple' composition"); + return 0; } } else if (composition->which == Z_RecordComp_complex) @@ -984,8 +987,8 @@ int bend_fetch(void *handle, bend_fetch_rr *rr) else { #if 0 /* For now ignore this error, which is ubiquitous in SRU */ - fprintf(stderr, "complex is weird\n"); rr->errcode = 26; + rr->errstring = odr_strdup(rr->stream, "'complex' composition is not generic ESN"); return 0; #endif /*0*/ } @@ -993,6 +996,7 @@ int bend_fetch(void *handle, bend_fetch_rr *rr) else { rr->errcode = 26; + rr->errstring = odr_strdup(rr->stream, "composition neither simple nor complex"); return 0; } } @@ -1157,6 +1161,7 @@ int bend_present(void *handle, bend_present_rr *rr) else { rr->errcode = 26; + rr->errstring = odr_strdup(rr->stream, "non-generic 'simple' composition"); return 0; } } @@ -1176,12 +1181,14 @@ int bend_present(void *handle, bend_present_rr *rr) else { rr->errcode = 26; + rr->errstring = odr_strdup(rr->stream, "'complex' composition is not generic ESN"); return 0; } } else { rr->errcode = 26; + rr->errstring = odr_strdup(rr->stream, "composition neither simple nor complex"); return 0; } }