summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-11-04 14:16:24 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-11-04 14:16:24 -0500
commit5aa28a8f2d47ac5939deffaabf70110e4ea29922 (patch)
treed108b9e1785eef799e15d9ebc3a41600280c8e53 /include/git2
parent610e553f5b43b4741b5c74d77cc1e07c88749bfc (diff)
parent7fafde632580f75ff3647ddf9e1e92ee388f317e (diff)
downloadlibgit2-5aa28a8f2d47ac5939deffaabf70110e4ea29922.tar.gz
Merge pull request #3465 from libgit2/cmn/tls-register
stream: allow registering a user-provided TLS constructor
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/sys/stream.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/sys/stream.h b/include/git2/sys/stream.h
index 55a714bbb..2b4ff7fd8 100644
--- a/include/git2/sys/stream.h
+++ b/include/git2/sys/stream.h
@@ -39,6 +39,19 @@ typedef struct git_stream {
void (*free)(struct git_stream *);
} git_stream;
+typedef int (*git_stream_cb)(git_stream **out, const char *host, const char *port);
+
+/**
+ * Register a TLS stream constructor for the library to use
+ *
+ * If a constructor is already set, it will be overwritten. Pass
+ * `NULL` in order to deregister the current constructor.
+ *
+ * @param ctor the constructor to use
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_stream_register_tls(git_stream_cb ctor);
+
GIT_END_DECL
#endif