summaryrefslogtreecommitdiffstats
path: root/src/uscxml/URL.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-12-01 11:02:40 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-12-01 11:02:40 (GMT)
commitaf6609592298c5e047e37e5ae2b47e6a8edbb677 (patch)
treee6e7da1cd34dccf3fb4f389e684b7c899b12987a /src/uscxml/URL.cpp
parentd2e90c02e5ad19a5857e7c7fb87f248182fdb32d (diff)
downloaduscxml-af6609592298c5e047e37e5ae2b47e6a8edbb677.zip
uscxml-af6609592298c5e047e37e5ae2b47e6a8edbb677.tar.gz
uscxml-af6609592298c5e047e37e5ae2b47e6a8edbb677.tar.bz2
Nested invokers and delayed events for PROMELA model checking
Diffstat (limited to 'src/uscxml/URL.cpp')
-rw-r--r--src/uscxml/URL.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/uscxml/URL.cpp b/src/uscxml/URL.cpp
index b1297d5..38cb780 100644
--- a/src/uscxml/URL.cpp
+++ b/src/uscxml/URL.cpp
@@ -562,6 +562,7 @@ std::ostream & operator<<(std::ostream & stream, const URL& url) {
URLFetcher::URLFetcher() {
_isStarted = false;
+ _envProxy = NULL;
_multiHandle = curl_multi_init();
// read proxy information from environment
@@ -575,15 +576,16 @@ URLFetcher::URLFetcher() {
// CURLOPT_PROXYUSERNAME;
// CURLOPT_PROXYUSERPWD;
- bool unsupported = false;
- CURLcode curlError;
-
/*
see http://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html
e.g. 'socks5://bob:marley@localhost:12345'
*/
- char* envProxy = getenv("USCXML_PROXY");
+ _envProxy = getenv("USCXML_PROXY");
+#if 0
+ bool unsupported = false;
+ CURLcode curlError;
+
// exposed just in case
char* envProxyTransferMode = getenv("USCXML_PROXY_TRANSFER_MODE");
char* envProxyAuth = getenv("USCXML_PROXYAUTH");
@@ -645,7 +647,8 @@ URLFetcher::URLFetcher() {
if (envProxyUserPwd)
(curlError = curl_easy_setopt(_multiHandle, CURLOPT_PROXYUSERPWD, envProxyUserPwd)) == CURLE_OK ||
LOG(ERROR) << "Cannot set curl proxy user password: " << curl_easy_strerror(curlError);
-
+#endif
+
start();
}
@@ -693,12 +696,16 @@ void URLFetcher::fetchURL(URL& url) {
(curlError = curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, false)) == CURLE_OK ||
LOG(ERROR) << "Cannot forfeit peer verification: " << curl_easy_strerror(curlError);
- (curlError = curl_easy_setopt(handle, CURLOPT_USERAGENT, "uscxml/0.3.3")) == CURLE_OK ||
+ (curlError = curl_easy_setopt(handle, CURLOPT_USERAGENT, "uscxml/" USCXML_VERSION)) == CURLE_OK ||
LOG(ERROR) << "Cannot set our user agent string: " << curl_easy_strerror(curlError);
(curlError = curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, true)) == CURLE_OK ||
LOG(ERROR) << "Cannot enable follow redirects: " << curl_easy_strerror(curlError);
+ if (instance->_envProxy)
+ (curlError = curl_easy_setopt(handle, CURLOPT_PROXY, instance->_envProxy)) == CURLE_OK ||
+ LOG(ERROR) << "Cannot set curl proxy: " << curl_easy_strerror(curlError);
+
if (iequals(url._impl->_requestType, "post")) {
(curlError = curl_easy_setopt(handle, CURLOPT_POST, 1)) == CURLE_OK ||