diff options
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/transport-helper.c b/transport-helper.c index 0eb3cf01aa..b934183236 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -54,7 +54,7 @@ static int recvline_fh(FILE *helper, struct strbuf *buffer, const char *name) strbuf_reset(buffer); if (debug) fprintf(stderr, "Debug: Remote helper: Waiting...\n"); - if (strbuf_getline(buffer, helper, '\n') == EOF) { + if (strbuf_getline(buffer, helper) == EOF) { if (debug) fprintf(stderr, "Debug: Remote helper quit.\n"); return 1; @@ -137,7 +137,8 @@ static struct child_process *get_helper(struct transport *transport) data->no_disconnect_req = 0; /* - * Open the output as FILE* so strbuf_getline() can be used. + * Open the output as FILE* so strbuf_getline_*() family of + * functions can be used. * Do this with duped fd because fclose() will close the fd, * and stuff like taking over will require the fd to remain. */ @@ -320,6 +321,21 @@ static void standard_options(struct transport *t) if (n >= sizeof(buf)) die("impossibly large verbosity value"); set_helper_option(t, "verbosity", buf); + + switch (t->family) { + case TRANSPORT_FAMILY_ALL: + /* + * this is already the default, + * do not break old remote helpers by setting "all" here + */ + break; + case TRANSPORT_FAMILY_IPV4: + set_helper_option(t, "family", "ipv4"); + break; + case TRANSPORT_FAMILY_IPV6: + set_helper_option(t, "family", "ipv6"); + break; + } } static int release_helper(struct transport *transport) |