diff options
-rw-r--r-- | src/vmime/parsingContext.cpp | 2 | ||||
-rw-r--r-- | src/vmime/parsingContext.hpp | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/vmime/parsingContext.cpp b/src/vmime/parsingContext.cpp index 0975e3d7..2ffdfa87 100644 --- a/src/vmime/parsingContext.cpp +++ b/src/vmime/parsingContext.cpp @@ -42,7 +42,7 @@ parsingContext::parsingContext(const parsingContext& ctx) parsingContext& parsingContext::getDefaultContext() { - static parsingContext ctx; + static thread_local parsingContext ctx; return ctx; } diff --git a/src/vmime/parsingContext.hpp b/src/vmime/parsingContext.hpp index d13d94ef..1107fd57 100644 --- a/src/vmime/parsingContext.hpp +++ b/src/vmime/parsingContext.hpp @@ -42,6 +42,12 @@ struct headerParseRecoveryMethod { }; /** Holds configuration parameters used for parsing messages. + * + * Within vmime there are some functions that only utilize the default parsing + * context. If you need to manipulate the behavior of the parser for those + * functions, it is suggested to get the default context and make the + * appropriate set calls to adjust the behavior. You can also use this + * instance when making function calls the require a context be passed in. */ class VMIME_EXPORT parsingContext : public context { @@ -50,9 +56,10 @@ public: parsingContext(); parsingContext(const parsingContext& ctx); - /** Returns the default context used for parsing messages. + /** Returns the default context used for parsing messages. The context + * is scoped as a thread local variable. * - * @return a reference to the default parsing context + * @return a reference to the default parsing context for that thread */ static parsingContext& getDefaultContext(); |