diff options
Diffstat (limited to 'src/common/linux/libcurl_wrapper.h')
-rw-r--r-- | src/common/linux/libcurl_wrapper.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/common/linux/libcurl_wrapper.h b/src/common/linux/libcurl_wrapper.h index 77aa6cbb..f8f961c1 100644 --- a/src/common/linux/libcurl_wrapper.h +++ b/src/common/linux/libcurl_wrapper.h @@ -1,5 +1,4 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. +// Copyright 2009 Google LLC // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -11,7 +10,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of Google LLC nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -40,6 +39,9 @@ #include "third_party/curl/curl.h" namespace google_breakpad { + +// This class is only safe to be used on single-threaded code because of its +// usage of libcurl's curl_global_cleanup(). class LibcurlWrapper { public: LibcurlWrapper(); @@ -91,27 +93,28 @@ class LibcurlWrapper { // dealing // with CURL. - CURL *curl_; // Pointer for handle for CURL calls. + CURL* curl_; // Pointer for handle for CURL calls. CURL* (*easy_init_)(void); // Stateful pointers for calling into curl_formadd() - struct curl_httppost *formpost_; - struct curl_httppost *lastptr_; - struct curl_slist *headerlist_; + struct curl_httppost* formpost_; + struct curl_httppost* lastptr_; + struct curl_slist* headerlist_; // Function pointers into CURL library - CURLcode (*easy_setopt_)(CURL *, CURLoption, ...); - CURLFORMcode (*formadd_)(struct curl_httppost **, - struct curl_httppost **, ...); - struct curl_slist* (*slist_append_)(struct curl_slist *, const char *); - void (*slist_free_all_)(struct curl_slist *); - CURLcode (*easy_perform_)(CURL *); + CURLcode (*easy_setopt_)(CURL*, CURLoption, ...); + CURLFORMcode (*formadd_)(struct curl_httppost**, + struct curl_httppost**, ...); + struct curl_slist* (*slist_append_)(struct curl_slist*, const char*); + void (*slist_free_all_)(struct curl_slist*); + CURLcode (*easy_perform_)(CURL*); const char* (*easy_strerror_)(CURLcode); - void (*easy_cleanup_)(CURL *); - CURLcode (*easy_getinfo_)(CURL *, CURLINFO info, ...); + void (*easy_cleanup_)(CURL*); + CURLcode (*easy_getinfo_)(CURL*, CURLINFO info, ...); void (*easy_reset_)(CURL*); - void (*formfree_)(struct curl_httppost *); + void (*formfree_)(struct curl_httppost*); + void (*global_cleanup_)(void); }; } |