From fd7b449fb3667261cfe664ea7b6c8d0586425c41 Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Sun, 7 Apr 2013 13:56:03 -0400 Subject: add -U to zwrite for UNACKED messages Based on a patch by Ray Link --- clients/zwrite/zwrite.1 | 8 ++++++++ clients/zwrite/zwrite.c | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/clients/zwrite/zwrite.1 b/clients/zwrite/zwrite.1 index 825e3cb..86472fa 100644 --- a/clients/zwrite/zwrite.1 +++ b/clients/zwrite/zwrite.1 @@ -32,6 +32,8 @@ zwrite \- write to another user via Zephyr ] [ .BI \-C ] [ +.BI \-U +] [ .BI \-O opcode ] [ .BI \-s @@ -140,6 +142,12 @@ necessarily indicate that this option was used, or that the message really was sent to the listed users, and its lack doesn't indicate that the message was not sent to multiple users. .TP +.B \-U +Send an unacked message. +.I zwrite +will not wait for acknowledgement that the message was sent, nor will +it issue a PING before sending. +.TP .B \-s \fIsignature\fR sets the signature to be included in the message. This overrides both the user's name (as found in the password file) and any diff --git a/clients/zwrite/zwrite.c b/clients/zwrite/zwrite.c index 0f1fcf9..aae3101 100644 --- a/clients/zwrite/zwrite.c +++ b/clients/zwrite/zwrite.c @@ -31,6 +31,7 @@ static const char rcsid_zwrite_c[] = "$Id$"; int nrecips, msgarg, verbose, quiet, nodot, cc; char *whoami, *inst, *class, *opcode, *realm, *recips[MAXRECIPS], *sender = 0; Z_AuthProc auth; +ZNotice_Kind_t kind = ACKED; void un_tabify(char **, int *); char *fix_filsrv_inst(char *); @@ -196,6 +197,10 @@ main(int argc, char *argv[]) sender = argv[arg]; auth = ZNOAUTH; break; + case 'U': + kind = UNACKED; + nocheck = 1; /* implied -n (no ping) */ + break; default: usage(whoami); } @@ -234,7 +239,7 @@ main(int argc, char *argv[]) } memset(¬ice, 0, sizeof(ZNotice_t)); - notice.z_kind = ACKED; + notice.z_kind = kind; notice.z_port = 0; notice.z_class = class; notice.z_class_inst = inst; @@ -381,6 +386,8 @@ send_off(ZNotice_t *notice, int real) com_err(whoami, retval, "while sending notice to %s", dest); break; } + if (kind == UNACKED) + continue; if (real && !quiet) { if (verbose) printf("Queued... "); -- cgit v1.2.3