From 17df2d8f8ee7864996c8a6a45886ccd6e34d065d Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Wed, 26 Feb 2014 21:02:53 +0000 Subject: tool_cfgable: Added GlobalConfig pointer to OperationConfig In order to ease the moving of global options such as the error stream, updated the OperationConfig structure to point to the GlobalConfig. --- src/tool_cfgable.h | 3 +++ src/tool_getparam.c | 3 +++ src/tool_parsecfg.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index e88b97896..77c603752 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -27,6 +27,8 @@ #include "tool_metalink.h" +struct GlobalConfig; + struct OperationConfig { CURL *easy; /* A copy of the handle from GlobalConfig */ bool remote_time; @@ -213,6 +215,7 @@ struct OperationConfig { bool nonpn; /* enable/disable TLS NPN extension */ bool noalpn; /* enable/disable TLS ALPN extension */ + struct GlobalConfig *global; struct OperationConfig* prev; struct OperationConfig* next; /* Always last in the struct */ }; diff --git a/src/tool_getparam.c b/src/tool_getparam.c index e4cc69dd1..b9c5eb701 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -1838,6 +1838,9 @@ ParameterError parse_args(struct GlobalConfig *config, int argc, /* Copy the easy handle */ operation->next->easy = config->easy; + /* Set the global config pointer */ + operation->next->global = config; + /* Update the last operation pointer */ config->last = operation->next; diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 9adbe8229..53e2660a6 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -236,6 +236,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global) /* Copy the easy handle */ operation->next->easy = global->easy; + /* Set the global config pointer */ + operation->next->global = global; + /* Update the last operation pointer */ global->last = operation->next; -- cgit v1.2.3