summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r--usr.bin/aucat/amsg.h3
-rw-r--r--usr.bin/aucat/sock.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/aucat/amsg.h b/usr.bin/aucat/amsg.h
index f0563e9019a..7536f99c7b9 100644
--- a/usr.bin/aucat/amsg.h
+++ b/usr.bin/aucat/amsg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amsg.h,v 1.9 2009/07/25 10:52:18 ratchov Exp $ */
+/* $OpenBSD: amsg.h,v 1.10 2009/08/28 06:37:06 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -39,6 +39,7 @@ struct amsg {
#define AMSG_GETCAP 7 /* get capabilities */
#define AMSG_SETVOL 8 /* set volume */
#define AMSG_HELLO 9 /* say hello, check versions and so ... */
+#define AMSG_BYE 10 /* ask server to drop connection */
uint32_t cmd;
uint32_t __pad;
union {
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);