summaryrefslogtreecommitdiffstats
path: root/src/dispatch.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-06-02 18:48:17 -0400
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2008-06-02 18:48:17 -0400
commit9d59fc6ad7f6445ce1e498d3d88e2004e76b43a9 (patch)
tree1bf93c6c6c5de8059d485547f853c87f928b9d36 /src/dispatch.c
parentdb8533d18e58ae28fc85cefa61358a945bc1d91f (diff)
downloadslapi-nis-9d59fc6ad7f6445ce1e498d3d88e2004e76b43a9.tar.gz
slapi-nis-9d59fc6ad7f6445ce1e498d3d88e2004e76b43a9.tar.xz
slapi-nis-9d59fc6ad7f6445ce1e498d3d88e2004e76b43a9.zip
- provide a more useful error when a reply is too large for a dgram, so that
nis clients won't appear to hang
Diffstat (limited to 'src/dispatch.c')
-rw-r--r--src/dispatch.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/dispatch.c b/src/dispatch.c
index 7ab93f0..bc0508d 100644
--- a/src/dispatch.c
+++ b/src/dispatch.c
@@ -126,6 +126,20 @@ dispatch_reply_fragment_dgram(struct plugin_state *state,
slapi_log_error(SLAPI_LOG_PLUGIN,
state->plugin_desc->spd_id,
"error sending datagram reply -- too large?\n");
+ xdr_setpos(reply_xdrs, 0);
+ reply->rm_reply.rp_acpt.ar_stat = SYSTEM_ERR;
+ reply->rm_reply.rp_acpt.ar_results.proc = (xdrproc_t) &xdr_void;
+ reply->rm_reply.rp_acpt.ar_results.where = NULL;
+ if (xdr_replymsg(reply_xdrs, reply)) {
+ slapi_log_error(SLAPI_LOG_PLUGIN,
+ state->plugin_desc->spd_id,
+ "sending system-error response\n");
+ sendto(cdata->dgram.client_fd,
+ cdata->dgram.reply_buf, xdr_getpos(reply_xdrs),
+ 0,
+ &cdata->dgram.client_addr,
+ cdata->dgram.client_addrlen);
+ }
}
return TRUE;
}