2018-03-15 20:31:19 +03:00
|
|
|
#include "cache.h"
|
|
|
|
#include "repository.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "pkt-line.h"
|
|
|
|
#include "version.h"
|
2020-07-28 23:23:39 +03:00
|
|
|
#include "strvec.h"
|
2018-03-15 20:31:20 +03:00
|
|
|
#include "ls-refs.h"
|
2021-04-21 02:38:31 +03:00
|
|
|
#include "protocol-caps.h"
|
2018-03-15 20:31:19 +03:00
|
|
|
#include "serve.h"
|
2018-03-15 20:31:27 +03:00
|
|
|
#include "upload-pack.h"
|
2018-03-15 20:31:19 +03:00
|
|
|
|
2021-08-05 04:25:39 +03:00
|
|
|
static int advertise_sid = -1;
|
2020-11-12 02:29:29 +03:00
|
|
|
|
2018-03-15 20:31:20 +03:00
|
|
|
static int always_advertise(struct repository *r,
|
|
|
|
struct strbuf *value)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-03-15 20:31:19 +03:00
|
|
|
static int agent_advertise(struct repository *r,
|
|
|
|
struct strbuf *value)
|
|
|
|
{
|
|
|
|
if (value)
|
|
|
|
strbuf_addstr(value, git_user_agent_sanitized());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2020-05-25 22:59:17 +03:00
|
|
|
static int object_format_advertise(struct repository *r,
|
|
|
|
struct strbuf *value)
|
|
|
|
{
|
|
|
|
if (value)
|
|
|
|
strbuf_addstr(value, r->hash_algo->name);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2020-11-12 02:29:29 +03:00
|
|
|
static int session_id_advertise(struct repository *r, struct strbuf *value)
|
|
|
|
{
|
2021-08-05 04:25:39 +03:00
|
|
|
if (advertise_sid == -1 &&
|
|
|
|
git_config_get_bool("transfer.advertisesid", &advertise_sid))
|
|
|
|
advertise_sid = 0;
|
2020-11-12 02:29:29 +03:00
|
|
|
if (!advertise_sid)
|
|
|
|
return 0;
|
|
|
|
if (value)
|
|
|
|
strbuf_addstr(value, trace2_session_id());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-03-15 20:31:19 +03:00
|
|
|
struct protocol_capability {
|
|
|
|
/*
|
|
|
|
* The name of the capability. The server uses this name when
|
|
|
|
* advertising this capability, and the client uses this name to
|
|
|
|
* specify this capability.
|
|
|
|
*/
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function queried to see if a capability should be advertised.
|
|
|
|
* Optionally a value can be specified by adding it to 'value'.
|
|
|
|
* If a value is added to 'value', the server will advertise this
|
|
|
|
* capability as "<name>=<value>" instead of "<name>".
|
|
|
|
*/
|
|
|
|
int (*advertise)(struct repository *r, struct strbuf *value);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function called when a client requests the capability as a command.
|
2021-08-05 04:25:38 +03:00
|
|
|
* Will be provided a struct packet_reader 'request' which it should
|
2018-03-15 20:31:19 +03:00
|
|
|
* use to read the command specific part of the request. Every command
|
|
|
|
* MUST read until a flush packet is seen before sending a response.
|
|
|
|
*
|
|
|
|
* This field should be NULL for capabilities which are not commands.
|
|
|
|
*/
|
2021-08-05 04:25:38 +03:00
|
|
|
int (*command)(struct repository *r, struct packet_reader *request);
|
2018-03-15 20:31:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct protocol_capability capabilities[] = {
|
2021-08-05 04:25:37 +03:00
|
|
|
{
|
|
|
|
.name = "agent",
|
|
|
|
.advertise = agent_advertise,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "ls-refs",
|
|
|
|
.advertise = ls_refs_advertise,
|
|
|
|
.command = ls_refs,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "fetch",
|
|
|
|
.advertise = upload_pack_advertise,
|
|
|
|
.command = upload_pack_v2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "server-option",
|
|
|
|
.advertise = always_advertise,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "object-format",
|
|
|
|
.advertise = object_format_advertise,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "session-id",
|
|
|
|
.advertise = session_id_advertise,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.name = "object-info",
|
|
|
|
.advertise = always_advertise,
|
|
|
|
.command = cap_object_info,
|
|
|
|
},
|
2018-03-15 20:31:19 +03:00
|
|
|
};
|
|
|
|
|
serve.[ch]: remove "serve_options", split up --advertise-refs code
The "advertise capabilities" mode of serve.c added in
ed10cb952d3 (serve: introduce git-serve, 2018-03-15) is only used by
the http-backend.c to call {upload,receive}-pack with the
--advertise-refs parameter. See 42526b478e3 (Add stateless RPC options
to upload-pack, receive-pack, 2009-10-30).
Let's just make cmd_upload_pack() take the two (v2) or three (v2)
parameters the the v2/v1 servicing functions need directly, and pass
those in via the function signature. The logic of whether daemon mode
is implied by the timeout belongs in the v1 function (only used
there).
Once we split up the "advertise v2 refs" from "serve v2 request" it
becomes clear that v2 never cared about those in combination. The only
time it mattered was for v1 to emit its ref advertisement, in that
case we wanted to emit the smart-http-only "no-done" capability.
Since we only do that in the --advertise-refs codepath let's just have
it set "do_done" itself in v1's upload_pack() just before send_ref(),
at that point --advertise-refs and --stateless-rpc in combination are
redundant (the only user is get_info_refs() in http-backend.c), so we
can just pass in --advertise-refs only.
Since we need to touch all the serve() and advertise_capabilities()
codepaths let's rename them to less clever and obvious names, it's
been suggested numerous times, the latest of which is [1]'s suggestion
for protocol_v2_serve_loop(). Let's go with that.
1. https://lore.kernel.org/git/CAFQ2z_NyGb8rju5CKzmo6KhZXD0Dp21u-BbyCb2aNxLEoSPRJw@mail.gmail.com/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-05 04:25:42 +03:00
|
|
|
void protocol_v2_advertise_capabilities(void)
|
2018-03-15 20:31:19 +03:00
|
|
|
{
|
|
|
|
struct strbuf capability = STRBUF_INIT;
|
|
|
|
struct strbuf value = STRBUF_INIT;
|
|
|
|
int i;
|
|
|
|
|
2021-08-05 04:25:40 +03:00
|
|
|
/* serve by default supports v2 */
|
|
|
|
packet_write_fmt(1, "version 2\n");
|
|
|
|
|
2018-03-15 20:31:19 +03:00
|
|
|
for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
|
|
|
|
struct protocol_capability *c = &capabilities[i];
|
|
|
|
|
|
|
|
if (c->advertise(the_repository, &value)) {
|
|
|
|
strbuf_addstr(&capability, c->name);
|
|
|
|
|
|
|
|
if (value.len) {
|
|
|
|
strbuf_addch(&capability, '=');
|
|
|
|
strbuf_addbuf(&capability, &value);
|
|
|
|
}
|
|
|
|
|
|
|
|
strbuf_addch(&capability, '\n');
|
|
|
|
packet_write(1, capability.buf, capability.len);
|
|
|
|
}
|
|
|
|
|
|
|
|
strbuf_reset(&capability);
|
|
|
|
strbuf_reset(&value);
|
|
|
|
}
|
|
|
|
|
|
|
|
packet_flush(1);
|
|
|
|
strbuf_release(&capability);
|
|
|
|
strbuf_release(&value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct protocol_capability *get_capability(const char *key)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!key)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
|
|
|
|
struct protocol_capability *c = &capabilities[i];
|
|
|
|
const char *out;
|
|
|
|
if (skip_prefix(key, c->name, &out) && (!*out || *out == '='))
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int is_valid_capability(const char *key)
|
|
|
|
{
|
|
|
|
const struct protocol_capability *c = get_capability(key);
|
|
|
|
|
|
|
|
return c && c->advertise(the_repository, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int is_command(const char *key, struct protocol_capability **command)
|
|
|
|
{
|
|
|
|
const char *out;
|
|
|
|
|
|
|
|
if (skip_prefix(key, "command=", &out)) {
|
|
|
|
struct protocol_capability *cmd = get_capability(out);
|
|
|
|
|
|
|
|
if (*command)
|
|
|
|
die("command '%s' requested after already requesting command '%s'",
|
|
|
|
out, (*command)->name);
|
|
|
|
if (!cmd || !cmd->advertise(the_repository, NULL) || !cmd->command)
|
|
|
|
die("invalid command '%s'", out);
|
|
|
|
|
|
|
|
*command = cmd;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-08-05 04:25:34 +03:00
|
|
|
static int has_capability(const struct strvec *keys, const char *capability,
|
|
|
|
const char **value)
|
2018-03-15 20:31:19 +03:00
|
|
|
{
|
|
|
|
int i;
|
2020-07-29 03:37:20 +03:00
|
|
|
for (i = 0; i < keys->nr; i++) {
|
2018-03-15 20:31:19 +03:00
|
|
|
const char *out;
|
2020-07-29 03:37:20 +03:00
|
|
|
if (skip_prefix(keys->v[i], capability, &out) &&
|
2018-03-15 20:31:19 +03:00
|
|
|
(!*out || *out == '=')) {
|
|
|
|
if (value) {
|
|
|
|
if (*out == '=')
|
|
|
|
out++;
|
|
|
|
*value = out;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-07-28 23:25:12 +03:00
|
|
|
static void check_algorithm(struct repository *r, struct strvec *keys)
|
2020-05-25 22:59:17 +03:00
|
|
|
{
|
|
|
|
int client = GIT_HASH_SHA1, server = hash_algo_by_ptr(r->hash_algo);
|
|
|
|
const char *algo_name;
|
|
|
|
|
|
|
|
if (has_capability(keys, "object-format", &algo_name)) {
|
|
|
|
client = hash_algo_by_name(algo_name);
|
|
|
|
if (client == GIT_HASH_UNKNOWN)
|
|
|
|
die("unknown object format '%s'", algo_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (client != server)
|
|
|
|
die("mismatched object format: server %s; client %s\n",
|
|
|
|
r->hash_algo->name, hash_algos[client].name);
|
|
|
|
}
|
|
|
|
|
2018-03-15 20:31:19 +03:00
|
|
|
enum request_state {
|
|
|
|
PROCESS_REQUEST_KEYS,
|
|
|
|
PROCESS_REQUEST_DONE,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int process_request(void)
|
|
|
|
{
|
|
|
|
enum request_state state = PROCESS_REQUEST_KEYS;
|
|
|
|
struct packet_reader reader;
|
2020-07-28 23:25:12 +03:00
|
|
|
struct strvec keys = STRVEC_INIT;
|
2018-03-15 20:31:19 +03:00
|
|
|
struct protocol_capability *command = NULL;
|
2020-11-12 02:29:32 +03:00
|
|
|
const char *client_sid;
|
2018-03-15 20:31:19 +03:00
|
|
|
|
|
|
|
packet_reader_init(&reader, 0, NULL, 0,
|
|
|
|
PACKET_READ_CHOMP_NEWLINE |
|
pack-protocol.txt: accept error packets in any context
In the Git pack protocol definition, an error packet may appear only in
a certain context. However, servers can face a runtime error (e.g. I/O
error) at an arbitrary timing. This patch changes the protocol to allow
an error packet to be sent instead of any packet.
Without this protocol spec change, when a server cannot process a
request, there's no way to tell that to a client. Since the server
cannot produce a valid response, it would be forced to cut a connection
without telling why. With this protocol spec change, the server can be
more gentle in this situation. An old client may see these error packets
as an unexpected packet, but this is not worse than having an unexpected
EOF.
Following this protocol spec change, the error packet handling code is
moved to pkt-line.c. Implementation wise, this implementation uses
pkt-line to communicate with a subprocess. Since this is not a part of
Git protocol, it's possible that a packet that is not supposed to be an
error packet is mistakenly parsed as an error packet. This error packet
handling is enabled only for the Git pack protocol parsing code
considering this.
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-30 00:19:15 +03:00
|
|
|
PACKET_READ_GENTLE_ON_EOF |
|
|
|
|
PACKET_READ_DIE_ON_ERR_PACKET);
|
2018-03-15 20:31:19 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Check to see if the client closed their end before sending another
|
|
|
|
* request. If so we can terminate the connection.
|
|
|
|
*/
|
|
|
|
if (packet_reader_peek(&reader) == PACKET_READ_EOF)
|
|
|
|
return 1;
|
pack-protocol.txt: accept error packets in any context
In the Git pack protocol definition, an error packet may appear only in
a certain context. However, servers can face a runtime error (e.g. I/O
error) at an arbitrary timing. This patch changes the protocol to allow
an error packet to be sent instead of any packet.
Without this protocol spec change, when a server cannot process a
request, there's no way to tell that to a client. Since the server
cannot produce a valid response, it would be forced to cut a connection
without telling why. With this protocol spec change, the server can be
more gentle in this situation. An old client may see these error packets
as an unexpected packet, but this is not worse than having an unexpected
EOF.
Following this protocol spec change, the error packet handling code is
moved to pkt-line.c. Implementation wise, this implementation uses
pkt-line to communicate with a subprocess. Since this is not a part of
Git protocol, it's possible that a packet that is not supposed to be an
error packet is mistakenly parsed as an error packet. This error packet
handling is enabled only for the Git pack protocol parsing code
considering this.
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-12-30 00:19:15 +03:00
|
|
|
reader.options &= ~PACKET_READ_GENTLE_ON_EOF;
|
2018-03-15 20:31:19 +03:00
|
|
|
|
|
|
|
while (state != PROCESS_REQUEST_DONE) {
|
|
|
|
switch (packet_reader_peek(&reader)) {
|
|
|
|
case PACKET_READ_EOF:
|
|
|
|
BUG("Should have already died when seeing EOF");
|
|
|
|
case PACKET_READ_NORMAL:
|
|
|
|
/* collect request; a sequence of keys and values */
|
|
|
|
if (is_command(reader.line, &command) ||
|
|
|
|
is_valid_capability(reader.line))
|
2020-07-28 23:25:12 +03:00
|
|
|
strvec_push(&keys, reader.line);
|
2018-03-15 20:31:19 +03:00
|
|
|
else
|
|
|
|
die("unknown capability '%s'", reader.line);
|
|
|
|
|
|
|
|
/* Consume the peeked line */
|
|
|
|
packet_reader_read(&reader);
|
|
|
|
break;
|
|
|
|
case PACKET_READ_FLUSH:
|
|
|
|
/*
|
|
|
|
* If no command and no keys were given then the client
|
|
|
|
* wanted to terminate the connection.
|
|
|
|
*/
|
2020-07-29 03:37:20 +03:00
|
|
|
if (!keys.nr)
|
2018-03-15 20:31:19 +03:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The flush packet isn't consume here like it is in
|
|
|
|
* the other parts of this switch statement. This is
|
|
|
|
* so that the command can read the flush packet and
|
|
|
|
* see the end of the request in the same way it would
|
|
|
|
* if command specific arguments were provided after a
|
|
|
|
* delim packet.
|
|
|
|
*/
|
|
|
|
state = PROCESS_REQUEST_DONE;
|
|
|
|
break;
|
|
|
|
case PACKET_READ_DELIM:
|
|
|
|
/* Consume the peeked line */
|
|
|
|
packet_reader_read(&reader);
|
|
|
|
|
|
|
|
state = PROCESS_REQUEST_DONE;
|
|
|
|
break;
|
2020-05-19 13:53:59 +03:00
|
|
|
case PACKET_READ_RESPONSE_END:
|
2021-07-09 05:27:22 +03:00
|
|
|
BUG("unexpected response end packet");
|
2018-03-15 20:31:19 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!command)
|
|
|
|
die("no command requested");
|
|
|
|
|
2020-05-25 22:59:17 +03:00
|
|
|
check_algorithm(the_repository, &keys);
|
|
|
|
|
2020-11-12 02:29:32 +03:00
|
|
|
if (has_capability(&keys, "session-id", &client_sid))
|
|
|
|
trace2_data_string("transfer", NULL, "client-sid", client_sid);
|
|
|
|
|
2021-08-05 04:25:38 +03:00
|
|
|
command->command(the_repository, &reader);
|
2018-03-15 20:31:19 +03:00
|
|
|
|
2020-07-28 23:25:12 +03:00
|
|
|
strvec_clear(&keys);
|
2018-03-15 20:31:19 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
serve.[ch]: remove "serve_options", split up --advertise-refs code
The "advertise capabilities" mode of serve.c added in
ed10cb952d3 (serve: introduce git-serve, 2018-03-15) is only used by
the http-backend.c to call {upload,receive}-pack with the
--advertise-refs parameter. See 42526b478e3 (Add stateless RPC options
to upload-pack, receive-pack, 2009-10-30).
Let's just make cmd_upload_pack() take the two (v2) or three (v2)
parameters the the v2/v1 servicing functions need directly, and pass
those in via the function signature. The logic of whether daemon mode
is implied by the timeout belongs in the v1 function (only used
there).
Once we split up the "advertise v2 refs" from "serve v2 request" it
becomes clear that v2 never cared about those in combination. The only
time it mattered was for v1 to emit its ref advertisement, in that
case we wanted to emit the smart-http-only "no-done" capability.
Since we only do that in the --advertise-refs codepath let's just have
it set "do_done" itself in v1's upload_pack() just before send_ref(),
at that point --advertise-refs and --stateless-rpc in combination are
redundant (the only user is get_info_refs() in http-backend.c), so we
can just pass in --advertise-refs only.
Since we need to touch all the serve() and advertise_capabilities()
codepaths let's rename them to less clever and obvious names, it's
been suggested numerous times, the latest of which is [1]'s suggestion
for protocol_v2_serve_loop(). Let's go with that.
1. https://lore.kernel.org/git/CAFQ2z_NyGb8rju5CKzmo6KhZXD0Dp21u-BbyCb2aNxLEoSPRJw@mail.gmail.com/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-05 04:25:42 +03:00
|
|
|
void protocol_v2_serve_loop(int stateless_rpc)
|
2018-03-15 20:31:19 +03:00
|
|
|
{
|
serve.[ch]: remove "serve_options", split up --advertise-refs code
The "advertise capabilities" mode of serve.c added in
ed10cb952d3 (serve: introduce git-serve, 2018-03-15) is only used by
the http-backend.c to call {upload,receive}-pack with the
--advertise-refs parameter. See 42526b478e3 (Add stateless RPC options
to upload-pack, receive-pack, 2009-10-30).
Let's just make cmd_upload_pack() take the two (v2) or three (v2)
parameters the the v2/v1 servicing functions need directly, and pass
those in via the function signature. The logic of whether daemon mode
is implied by the timeout belongs in the v1 function (only used
there).
Once we split up the "advertise v2 refs" from "serve v2 request" it
becomes clear that v2 never cared about those in combination. The only
time it mattered was for v1 to emit its ref advertisement, in that
case we wanted to emit the smart-http-only "no-done" capability.
Since we only do that in the --advertise-refs codepath let's just have
it set "do_done" itself in v1's upload_pack() just before send_ref(),
at that point --advertise-refs and --stateless-rpc in combination are
redundant (the only user is get_info_refs() in http-backend.c), so we
can just pass in --advertise-refs only.
Since we need to touch all the serve() and advertise_capabilities()
codepaths let's rename them to less clever and obvious names, it's
been suggested numerous times, the latest of which is [1]'s suggestion
for protocol_v2_serve_loop(). Let's go with that.
1. https://lore.kernel.org/git/CAFQ2z_NyGb8rju5CKzmo6KhZXD0Dp21u-BbyCb2aNxLEoSPRJw@mail.gmail.com/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-05 04:25:42 +03:00
|
|
|
if (!stateless_rpc)
|
|
|
|
protocol_v2_advertise_capabilities();
|
2018-03-15 20:31:19 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If stateless-rpc was requested then exit after
|
|
|
|
* a single request/response exchange
|
|
|
|
*/
|
serve.[ch]: remove "serve_options", split up --advertise-refs code
The "advertise capabilities" mode of serve.c added in
ed10cb952d3 (serve: introduce git-serve, 2018-03-15) is only used by
the http-backend.c to call {upload,receive}-pack with the
--advertise-refs parameter. See 42526b478e3 (Add stateless RPC options
to upload-pack, receive-pack, 2009-10-30).
Let's just make cmd_upload_pack() take the two (v2) or three (v2)
parameters the the v2/v1 servicing functions need directly, and pass
those in via the function signature. The logic of whether daemon mode
is implied by the timeout belongs in the v1 function (only used
there).
Once we split up the "advertise v2 refs" from "serve v2 request" it
becomes clear that v2 never cared about those in combination. The only
time it mattered was for v1 to emit its ref advertisement, in that
case we wanted to emit the smart-http-only "no-done" capability.
Since we only do that in the --advertise-refs codepath let's just have
it set "do_done" itself in v1's upload_pack() just before send_ref(),
at that point --advertise-refs and --stateless-rpc in combination are
redundant (the only user is get_info_refs() in http-backend.c), so we
can just pass in --advertise-refs only.
Since we need to touch all the serve() and advertise_capabilities()
codepaths let's rename them to less clever and obvious names, it's
been suggested numerous times, the latest of which is [1]'s suggestion
for protocol_v2_serve_loop(). Let's go with that.
1. https://lore.kernel.org/git/CAFQ2z_NyGb8rju5CKzmo6KhZXD0Dp21u-BbyCb2aNxLEoSPRJw@mail.gmail.com/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-05 04:25:42 +03:00
|
|
|
if (stateless_rpc) {
|
2018-03-15 20:31:19 +03:00
|
|
|
process_request();
|
|
|
|
} else {
|
|
|
|
for (;;)
|
|
|
|
if (process_request())
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|