summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/sock.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-08-28 06:37:07 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-08-28 06:37:07 +0000
commitb9b63c93e2e7a08427280392434f8d6af74d4158 (patch)
treeb5bf49fe8fa35aad5b50af8ef9980da8d372c2bd /usr.bin/aucat/sock.c
parent33a599c08e1d6be6abccee59b873302795b62621 (diff)
add a new AMSG_BYE, sent by the client to requst the server to
free resources and drop the connection. This allows the client to ensuire that at any time it's using only one connection, thus only one MIDI control channel.
Diffstat (limited to 'usr.bin/aucat/sock.c')
-rw-r--r--usr.bin/aucat/sock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/aucat/sock.c b/usr.bin/aucat/sock.c
index 2c0e0705366..d79ec01f04d 100644
--- a/usr.bin/aucat/sock.c
+++ b/usr.bin/aucat/sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sock.c,v 1.27 2009/08/27 06:54:23 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.28 2009/08/28 06:37:06 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -947,6 +947,12 @@ sock_execmsg(struct sock *f)
f->rstate = SOCK_RRET;
f->rtodo = sizeof(struct amsg);
break;
+ case AMSG_BYE:
+ DPRINTFN(2, "sock_execmsg: %p: BYE\n", f);
+ if (f->pstate != SOCK_INIT)
+ DPRINTF("sock_execmsg: %p: BYE, bad state\n", f);
+ aproc_del(f->pipe.file.rproc);
+ return 0;
default:
DPRINTF("sock_execmsg: %p bogus command\n", f);
aproc_del(f->pipe.file.rproc);