/* libguestfs - the guestfsd daemon
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
if (xdrp) {
+ /* This can fail if the reply body is too large, for example
+ * if it exceeds the maximum message size. In that case
+ * we want to return an error message instead. (RHBZ#509597).
+ */
if (!(*xdrp) (&xdr, ret)) {
- fprintf (stderr, "guestfsd: failed to encode reply body\n");
- exit (1);
+ reply_with_perror ("guestfsd: failed to encode reply body\n");
+ xdr_destroy (&xdr);
+ return;
}
}