summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connect.c15
-rw-r--r--connect.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/connect.c b/connect.c
index 2b55a32d4d..ad0e4e8e56 100644
--- a/connect.c
+++ b/connect.c
@@ -84,6 +84,21 @@ int server_supports_v2(const char *c, int die_on_error)
return 0;
}
+int server_feature_v2(const char *c, const char **v)
+{
+ int i;
+
+ for (i = 0; i < server_capabilities_v2.argc; i++) {
+ const char *out;
+ if (skip_prefix(server_capabilities_v2.argv[i], c, &out) &&
+ (*out == '=')) {
+ *v = out + 1;
+ return 1;
+ }
+ }
+ return 0;
+}
+
int server_supports_feature(const char *c, const char *feature,
int die_on_error)
{
diff --git a/connect.h b/connect.h
index 5f2382e018..4d76a6017d 100644
--- a/connect.h
+++ b/connect.h
@@ -19,6 +19,7 @@ struct packet_reader;
enum protocol_version discover_version(struct packet_reader *reader);
int server_supports_v2(const char *c, int die_on_error);
+int server_feature_v2(const char *c, const char **v);
int server_supports_feature(const char *c, const char *feature,
int die_on_error);