This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "sfcb - Small Footprint CIM Broker".
The branch, master has been updated
via bd3cc9b7cb9a5cda53ac2ff67ef336cd500a7bc0 (commit)
from c29c15e5d73d70bf547c71167f9816e54897718a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bd3cc9b7cb9a5cda53ac2ff67ef336cd500a7bc0
Author: Dave Heller <hel...@us...>
Date: Thu Feb 20 20:31:20 2014 -0500
[sfcb-tix:#101] Add config property indicationCurlUseExpect100
-----------------------------------------------------------------------
Summary of changes:
control.c | 1 +
indCIMXMLExport.c | 5 +++++
sfcb.cfg.pre.in | 15 +++++++++++++++
3 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/control.c b/control.c
index 833e3bb..86c17cb 100644
--- a/control.c
+++ b/control.c
@@ -200,6 +200,7 @@ static Control init[] = {
{"MaxListenerDestinations", CTL_LONG, NULL, {.slong=100}},
{"MaxActiveSubscriptions", CTL_LONG, NULL, {.slong=100}},
{"indicationCurlTimeout", CTL_LONG, NULL, {.slong=10}},
+ {"indicationCurlUseExpect100", CTL_BOOL, NULL, {.b=0}},
};
static Control *cache;
diff --git a/indCIMXMLExport.c b/indCIMXMLExport.c
index 6b4184c..eaa5733 100644
--- a/indCIMXMLExport.c
+++ b/indCIMXMLExport.c
@@ -248,6 +248,11 @@ genRequest(CurlData * cd, char *url, char **msg)
// Initialize default headers
initializeHeaders(cd);
+ /* Curl does Expect:100-continue unless we tell it not to */
+ int opt;
+ if (getControlBool("indicationCurlUseExpect100", &opt) || !opt)
+ cd->mHeaders = curl_slist_append(cd->mHeaders, "Expect: ");
+
// Set all of the headers for the request
rv = curl_easy_setopt(cd->mHandle, CURLOPT_HTTPHEADER, cd->mHeaders);
diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in
index ef158eb..31e101d 100644
--- a/sfcb.cfg.pre.in
+++ b/sfcb.cfg.pre.in
@@ -361,6 +361,21 @@ sslCiphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
## Default is 10 seconds
#indicationCurlTimeout: 10
+## If true, instruct curl to use HTTP/1.1 Expect:100-continue behavior when
+## delivering indications. This means that curl will send the header and wait
+## up to 1s for a 100-continue reply (or other response code) before sending
+## the indication payload. This can in limited circumstances save network
+## bandwidth, etc. by allowing the destination handler to refuse delivery and
+## potentially redirect the indication to a different handler, before curl
+## delivers the payload. Otherwise the payload is delivered as normal, once
+## the handler sends the 100-continue or the 1s timeout expires. Note that if
+## the destination is not coded to handle HTTP/1.1 Expect:100-continue, this
+## will cause an unnecessary 1s delay in delivering each indication. For that
+## reason it recommnded to leave this off unless you understand your handlers'
+## behavior in this regard. May be useful with indicationCurlHonorRedirect.
+## Default is false
+#indicationCurlUseExpect100: false
+
##----------------------------Reliable Indications ----------------------------
## Interval between indication retry attempts
## Default is 20 seconds
hooks/post-receive
--
sfcb - Small Footprint CIM Broker
|