From: Niels Provos Date: Sun, 30 Mar 2008 21:06:33 +0000 (+0000) Subject: make RPC replies use application/octet-stream X-Git-Tag: release-2.0.1-alpha~391 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8920ac4ddf509be3981b00d5b13ed349359e4834;p=libevent make RPC replies use application/octet-stream svn:r694 --- diff --git a/ChangeLog b/ChangeLog index 020e9082..ef65b5e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,7 +60,8 @@ Changes in current version: o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks. o switch thread support so that locks get allocated as they are needed. o make event methods static so that they are not exported; from Andrei Nigmatulin - + o make RPC replies use application/octet-stream as mime type + Changes in 1.4.0: o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr. o demote most http warnings to debug messages diff --git a/evrpc.c b/evrpc.c index acebd620..a507d128 100644 --- a/evrpc.c +++ b/evrpc.c @@ -445,6 +445,11 @@ evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) if (hook_res == EVRPC_TERMINATE) goto error; + /* on success, we are going to transmit marshaled binary data */ + if (evhttp_find_header(req->output_headers, "Content-Type") == NULL) { + evhttp_add_header(req->output_headers, + "Content-Type", "application/octet-stream"); + } evhttp_send_reply(req, HTTP_OK, "OK", rpc_state->rpc_data); evrpc_reqstate_free(rpc_state);