summaryrefslogtreecommitdiff
path: root/src/transports/smart.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-08-18 20:55:59 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-08-19 02:23:18 +0200
commit47ed7e5acd5fe9fd8dfc1a6b9aac7603a50da25c (patch)
treeb74c3e9e8180f37a85c800e65190cf2378879c89 /src/transports/smart.c
parenta38afb9547534af3b0a3d09fc24057b68cc8cf6b (diff)
downloadlibgit2-47ed7e5acd5fe9fd8dfc1a6b9aac7603a50da25c.tar.gz
transport: provide a way to get the callbacks
libgit2 implementations of smart subtransports can simply reach through the structure, but external implementors cannot. Add these two functions as a way for the smart subtransports to get the callbacks as set by the user.
Diffstat (limited to 'src/transports/smart.c')
-rw-r--r--src/transports/smart.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/transports/smart.c b/src/transports/smart.c
index 85a49e543..31a2dec7b 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -372,6 +372,20 @@ static int ref_name_cmp(const void *a, const void *b)
return strcmp(ref_a->head.name, ref_b->head.name);
}
+int git_transport_smart_certificate_check(git_transport *transport, git_cert *cert, int valid, const char *hostname)
+{
+ transport_smart *t = (transport_smart *)transport;
+
+ return t->certificate_check_cb(cert, valid, hostname, t->message_cb_payload);
+}
+
+int git_transport_smart_credentials(git_cred **out, git_transport *transport, const char *user, int methods)
+{
+ transport_smart *t = (transport_smart *)transport;
+
+ return t->cred_acquire_cb(out, t->url, user, methods, t->cred_acquire_payload);
+}
+
int git_transport_smart(git_transport **out, git_remote *owner, void *param)
{
transport_smart *t;