summaryrefslogtreecommitdiff
path: root/src/joblist.c
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2012-11-21 23:03:45 +0100
committerArno Töll <arno@debian.org>2012-11-21 23:03:45 +0100
commit9fa7c3d770fb8688555b661940e04c3bf6b6d8aa (patch)
tree7d26c5c3a492656762910721988ee0867f7a57c4 /src/joblist.c
parentc99b717062c6228c4ac6df3831702f81c9806df4 (diff)
downloadlighttpd-9fa7c3d770fb8688555b661940e04c3bf6b6d8aa.tar.gz
Imported Upstream version 1.4.13~r1385upstream/1.4.13_r1385
Diffstat (limited to 'src/joblist.c')
-rw-r--r--src/joblist.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/joblist.c b/src/joblist.c
index dcab955..4ce3842 100644
--- a/src/joblist.c
+++ b/src/joblist.c
@@ -7,7 +7,7 @@
int joblist_append(server *srv, connection *con) {
if (con->in_joblist) return 0;
-
+
if (srv->joblist->size == 0) {
srv->joblist->size = 16;
srv->joblist->ptr = malloc(sizeof(*srv->joblist->ptr) * srv->joblist->size);
@@ -15,15 +15,15 @@ int joblist_append(server *srv, connection *con) {
srv->joblist->size += 16;
srv->joblist->ptr = realloc(srv->joblist->ptr, sizeof(*srv->joblist->ptr) * srv->joblist->size);
}
-
+
srv->joblist->ptr[srv->joblist->used++] = con;
-
+
return 0;
}
void joblist_free(server *srv, connections *joblist) {
UNUSED(srv);
-
+
free(joblist->ptr);
free(joblist);
}
@@ -31,14 +31,14 @@ void joblist_free(server *srv, connections *joblist) {
connection *fdwaitqueue_unshift(server *srv, connections *fdwaitqueue) {
connection *con;
UNUSED(srv);
-
-
+
+
if (fdwaitqueue->used == 0) return NULL;
-
+
con = fdwaitqueue->ptr[0];
-
+
memmove(fdwaitqueue->ptr, &(fdwaitqueue->ptr[1]), --fdwaitqueue->used * sizeof(*(fdwaitqueue->ptr)));
-
+
return con;
}
@@ -50,9 +50,9 @@ int fdwaitqueue_append(server *srv, connection *con) {
srv->fdwaitqueue->size += 16;
srv->fdwaitqueue->ptr = realloc(srv->fdwaitqueue->ptr, sizeof(*(srv->fdwaitqueue->ptr)) * srv->fdwaitqueue->size);
}
-
+
srv->fdwaitqueue->ptr[srv->fdwaitqueue->used++] = con;
-
+
return 0;
}