From: Adam Dickmeiss Date: Wed, 27 Jun 2012 07:59:46 +0000 (+0200) Subject: Different diagnostic for no record and given checksum X-Git-Tag: v1.6.15~7 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=6270643579b3496a2c51ef2c8abb0fb4b34726de;p=pazpar2-moved-to-github.git Different diagnostic for no record and given checksum --- diff --git a/src/http_command.c b/src/http_command.c index 122bef5..cbca61b 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -990,18 +990,18 @@ static void show_record(struct http_channel *c, struct http_session *s) for (i = 0; r; r = r->next) if (v == r->checksum) break; + if (!r) + error(rs, PAZPAR2_RECORD_FAIL, "no record"); } else { int offset = atoi(offsetstr); for (i = 0; i < offset && r; r = r->next, i++) ; + if (!r) + error(rs, PAZPAR2_RECORD_FAIL, "no record at offset given"); } - if (!r) - { - error(rs, PAZPAR2_RECORD_FAIL, "no record at offset given"); - } - else + if (r) { http_channel_observer_t obs = http_add_observer(c, r->client, show_raw_reset);