summaryrefslogtreecommitdiff
path: root/lib/altsvc.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-02-17 23:01:48 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-02-18 07:49:21 +0100
commit14916a82e23c22e1f3d3ebbd90421eb747480e99 (patch)
tree12adec5225ec862e7f330da1539e0d37e3aba105 /lib/altsvc.h
parent330f133224af18c65b9325d9b6502e07b4f09f6b (diff)
downloadcurl-14916a82e23c22e1f3d3ebbd90421eb747480e99.tar.gz
altsvc: make saving the cache an atomic operation
... by writing the file to temp name then rename to the final when done. Assisted-by: Jay Satiro Fixes #4936 Closes #4942
Diffstat (limited to 'lib/altsvc.h')
-rw-r--r--lib/altsvc.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/altsvc.h b/lib/altsvc.h
index 99d0499af..248e71eef 100644
--- a/lib/altsvc.h
+++ b/lib/altsvc.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2019 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -59,7 +59,8 @@ struct altsvcinfo {
const char *Curl_alpnid2str(enum alpnid id);
struct altsvcinfo *Curl_altsvc_init(void);
CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file);
-CURLcode Curl_altsvc_save(struct altsvcinfo *asi, const char *file);
+CURLcode Curl_altsvc_save(struct Curl_easy *data,
+ struct altsvcinfo *asi, const char *file);
CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl);
void Curl_altsvc_cleanup(struct altsvcinfo *altsvc);
CURLcode Curl_altsvc_parse(struct Curl_easy *data,
@@ -70,9 +71,9 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi,
enum alpnid srcalpnid, const char *srchost,
int srcport,
struct altsvc **dstentry,
- int versions); /* one or more CURLALTSVC_H* bits */
+ const int versions); /* CURLALTSVC_H* bits */
#else
/* disabled */
-#define Curl_altsvc_save(a,b)
+#define Curl_altsvc_save(a,b,c)
#endif /* CURL_DISABLE_HTTP || USE_ALTSVC */
#endif /* HEADER_CURL_ALTSVC_H */