projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug #2352: yaz-marcdump crashes for certain record.
[yaz-moved-to-github.git]
/
src
/
requestq.c
diff --git
a/src/requestq.c
b/src/requestq.c
index
bf9f7e2
..
7b06a39
100644
(file)
--- a/
src/requestq.c
+++ b/
src/requestq.c
@@
-1,14
+1,10
@@
-/*
- * Copyright (C) 1994-2003, Index Data.
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
- *
- * $Id: requestq.c,v 1.1 2003-10-27 12:21:35 adam Exp $
- *
*/
*/
-
-/*
- * Simple queue management.
+/**
+ * \file requestq.c
+ * \brief Implements Simple queue management for GFS.
*
* We also use the request-freelist to store encoding buffers, rather than
* freeing and xmalloc'ing them on each cycle.
*
* We also use the request-freelist to store encoding buffers, rather than
* freeing and xmalloc'ing them on each cycle.
@@
-22,9
+18,9
@@
void request_enq(request_q *q, request *r)
{
if (q->tail)
void request_enq(request_q *q, request *r)
{
if (q->tail)
- q->tail->next = r;
+ q->tail->next = r;
else
else
- q->head = r;
+ q->head = r;
q->tail = r;
q->num++;
}
q->tail = r;
q->num++;
}
@@
-39,10
+35,10
@@
request *request_deq(request_q *q)
request *r = q->head;
if (!r)
request *r = q->head;
if (!r)
- return 0;
+ return 0;
q->head = q->head->next;
if (!q->head)
q->head = q->head->next;
if (!q->head)
- q->tail = 0;
+ q->tail = 0;
q->num--;
return r;
}
q->num--;
return r;
}
@@
-58,7
+54,7
@@
void request_delq(request_q *q)
request *r1, *r = q->list;
while (r)
{
request *r1, *r = q->list;
while (r)
{
- xfree (r->response);
+ xfree (r->response);
r1 = r;
r = r->next;
xfree (r1);
r1 = r;
r = r->next;
xfree (r1);
@@
-70,13
+66,13
@@
request *request_get(request_q *q)
request *r = q->list;
if (r)
request *r = q->list;
if (r)
- q->list = r->next;
+ q->list = r->next;
else
{
else
{
- if (!(r = (request *)xmalloc(sizeof(*r))))
- abort();
- r->response = 0;
- r->size_response = 0;
+ if (!(r = (request *)xmalloc(sizeof(*r))))
+ abort();
+ r->response = 0;
+ r->size_response = 0;
}
r->q = q;
r->len_refid = 0;
}
r->q = q;
r->len_refid = 0;
@@
-98,3
+94,11
@@
void request_release(request *r)
q->list = r;
}
q->list = r;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+