]> granicus.if.org Git - libevent/commitdiff
make RPC replies use application/octet-stream
authorNiels Provos <provos@gmail.com>
Sun, 30 Mar 2008 21:06:33 +0000 (21:06 +0000)
committerNiels Provos <provos@gmail.com>
Sun, 30 Mar 2008 21:06:33 +0000 (21:06 +0000)
svn:r694

ChangeLog
evrpc.c

index 020e908207d1997fd82a99129871a1f688bb4c06..ef65b5e4676e2464cc13b7f6149c261e21d2219a 100644 (file)
--- 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 acebd6207976b75de7e6ace035de6ac393a00b8f..a507d1282f42f3b139cc02b71a21bb3b25e90c21 100644 (file)
--- 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);