#include "tool_cb_see.h"
#include "tool_cb_dbg.h"
#include "tool_helpers.h"
+#include "tool_version.h"
#define BUFFER_SIZE 102400L
if(proto_http || proto_rtsp) {
MY_SETOPT_STR(curl, CURLOPT_REFERER, config->referer);
- MY_SETOPT_STR(curl, CURLOPT_USERAGENT, config->useragent);
+ MY_SETOPT_STR(curl, CURLOPT_USERAGENT, config->useragent ?
+ config->useragent : CURL_NAME "/" CURL_VERSION);
}
if(use_proto == proto_http || use_proto == proto_https) {
operation = operation->next;
} while(!result && operation);
- /* Set the current operation pointer */
- global->current = global->first;
-
- /* now run! */
- result = run_all_transfers(share, result);
-
- if(global->ssl_sessions && feature_ssls_export) {
- CURLcode r2 = tool_ssls_save(global->first, share,
- global->ssl_sessions);
- if(r2 && !result)
- result = r2;
+ if(!result) {
+ /* Set the current operation pointer */
+ global->current = global->first;
+
+ /* now run! */
+ result = run_all_transfers(share, result);
+
+ if(global->ssl_sessions && feature_ssls_export) {
+ CURLcode r2 = tool_ssls_save(global->first, share,
+ global->ssl_sessions);
+ if(r2 && !result)
+ result = r2;
+ }
}
}
return CURLGSSAPI_DELEGATION_NONE;
}
-/*
- * my_useragent: returns allocated string with default user agent
- */
-static char *my_useragent(void)
-{
- return strdup(CURL_NAME "/" CURL_VERSION);
-}
-
#define isheadersep(x) ((((x)==':') || ((x)==';')))
/*
if(!result && config->proxyuserpwd)
result = checkpasswd("proxy", i, last, &config->proxyuserpwd);
- /* Check if we have a user agent */
- if(!result && !config->useragent) {
- config->useragent = my_useragent();
- if(!config->useragent) {
- errorf("out of memory");
- result = CURLE_OUT_OF_MEMORY;
- }
- }
-
return result;
}