summaryrefslogtreecommitdiff
path: root/usr.sbin/iscsid/connection.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2011-04-27 19:02:08 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2011-04-27 19:02:08 +0000
commitac7f39e07313a76b128b858151b40a6f39ca11cd (patch)
tree773f8d078459c6d7a093858db744c2595b0af2f8 /usr.sbin/iscsid/connection.c
parent2f979f221183b7e9822846d48694c990122de846 (diff)
Rename task_cleanup() to conn_task_cleanup() seems a better place for
this function since it does connections scheduling.
Diffstat (limited to 'usr.sbin/iscsid/connection.c')
-rw-r--r--usr.sbin/iscsid/connection.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/iscsid/connection.c b/usr.sbin/iscsid/connection.c
index 71da0a30644..8701d43d610 100644
--- a/usr.sbin/iscsid/connection.c
+++ b/usr.sbin/iscsid/connection.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: connection.c,v 1.9 2011/04/27 07:25:26 claudio Exp $ */
+/* $OpenBSD: connection.c,v 1.10 2011/04/27 19:02:07 claudio Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -236,12 +236,27 @@ conn_task_schedule(struct connection *c)
}
if (t->callback == NULL) {
/* no callback, immediate command expecting no answer */
- task_cleanup(t, c);
+ conn_task_cleanup(c, t);
free(t);
}
}
void
+conn_task_cleanup(struct connection *c, struct task *t)
+{
+/* XXX THIS FEELS WRONG FOR NOW */
+ pdu_free_queue(&t->sendq);
+ pdu_free_queue(&t->recvq);
+ /* XXX need some state to know if queued or not */
+ if (c) {
+ TAILQ_REMOVE(&c->tasks, t, entry);
+ if (!TAILQ_EMPTY(&c->tasks))
+ conn_task_schedule(c);
+ }
+}
+
+
+void
conn_pdu_write(struct connection *c, struct pdu *p)
{
struct iscsi_pdu *ipdu;