summaryrefslogtreecommitdiff
path: root/serve.c
diff options
context:
space:
mode:
Diffstat (limited to 'serve.c')
-rw-r--r--serve.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/serve.c b/serve.c
index fbd2fcdfb5..f6341206c4 100644
--- a/serve.c
+++ b/serve.c
@@ -3,7 +3,7 @@
#include "config.h"
#include "pkt-line.h"
#include "version.h"
-#include "argv-array.h"
+#include "strvec.h"
#include "ls-refs.h"
#include "serve.h"
#include "upload-pack.h"
@@ -56,7 +56,7 @@ struct protocol_capability {
* This field should be NULL for capabilities which are not commands.
*/
int (*command)(struct repository *r,
- struct argv_array *keys,
+ struct strvec *keys,
struct packet_reader *request);
};
@@ -142,13 +142,13 @@ static int is_command(const char *key, struct protocol_capability **command)
return 0;
}
-int has_capability(const struct argv_array *keys, const char *capability,
+int has_capability(const struct strvec *keys, const char *capability,
const char **value)
{
int i;
- for (i = 0; i < keys->argc; i++) {
+ for (i = 0; i < keys->nr; i++) {
const char *out;
- if (skip_prefix(keys->argv[i], capability, &out) &&
+ if (skip_prefix(keys->v[i], capability, &out) &&
(!*out || *out == '=')) {
if (value) {
if (*out == '=')
@@ -162,7 +162,7 @@ int has_capability(const struct argv_array *keys, const char *capability,
return 0;
}
-static void check_algorithm(struct repository *r, struct argv_array *keys)
+static void check_algorithm(struct repository *r, struct strvec *keys)
{
int client = GIT_HASH_SHA1, server = hash_algo_by_ptr(r->hash_algo);
const char *algo_name;
@@ -187,7 +187,7 @@ static int process_request(void)
{
enum request_state state = PROCESS_REQUEST_KEYS;
struct packet_reader reader;
- struct argv_array keys = ARGV_ARRAY_INIT;
+ struct strvec keys = STRVEC_INIT;
struct protocol_capability *command = NULL;
packet_reader_init(&reader, 0, NULL, 0,
@@ -211,7 +211,7 @@ static int process_request(void)
/* collect request; a sequence of keys and values */
if (is_command(reader.line, &command) ||
is_valid_capability(reader.line))
- argv_array_push(&keys, reader.line);
+ strvec_push(&keys, reader.line);
else
die("unknown capability '%s'", reader.line);
@@ -223,7 +223,7 @@ static int process_request(void)
* If no command and no keys were given then the client
* wanted to terminate the connection.
*/
- if (!keys.argc)
+ if (!keys.nr)
return 1;
/*
@@ -254,7 +254,7 @@ static int process_request(void)
command->command(the_repository, &keys, &reader);
- argv_array_clear(&keys);
+ strvec_clear(&keys);
return 0;
}