SYNC clients, when closing a channel, send a SYNC_COM_CHANNEL_CLOSE
command, and immediately disconnect before waiting for a response. So,
don't send a SYNC response, since by the time we send it, the other end
will most likely have already hung up, causing a lot of needless
'SYNC_putRes: write failed' messages whenever a SYNC channel is closed
(e.g. when a demand-salvage finishes).
Reviewed-on: http://gerrit.openafs.org/434
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if (com.hdr.command == SYNC_COM_CHANNEL_CLOSE) {
res.hdr.response = SYNC_OK;
res.hdr.flags |= SYNC_FLAG_CHANNEL_SHUTDOWN;
- goto respond;
+
+ /* don't respond, just drop; senders of SYNC_COM_CHANNEL_CLOSE
+ * never wait for a response. */
+ goto done;
}
res.hdr.com_seq = com.hdr.com_seq;
respond:
SYNC_putRes(&fssync_server_state, fd, &res);
+
+ done:
if (res.hdr.flags & SYNC_FLAG_CHANNEL_SHUTDOWN) {
FSYNC_Drop(fd);
}
if (com.hdr.command == SYNC_COM_CHANNEL_CLOSE) {
res.hdr.response = SYNC_OK;
res.hdr.flags |= SYNC_FLAG_CHANNEL_SHUTDOWN;
- goto respond;
+
+ /* don't respond, just drop; senders of SYNC_COM_CHANNEL_CLOSE
+ * never wait for a response. */
+ goto done;
}
if (com.recv_len != (sizeof(com.hdr) + sizeof(SALVSYNC_command_hdr))) {
respond:
SYNC_putRes(&salvsync_server_state, fd, &res);
+
+ done:
if (res.hdr.flags & SYNC_FLAG_CHANNEL_SHUTDOWN) {
SALVSYNC_Drop(fd);
}