Skip to content
Permalink
Browse files

Merge pull request #2111 from gitgitgadget/jk/no-sigpipe-during-netwo…

…rk-transport

Fix t5570 flakiness on macOS
  • Loading branch information...
dscho committed Mar 7, 2019
2 parents 89cb7de + 1435889 commit 1a02835a1ed7edf3e94441473255adf3c85b8f0d
Showing with 12 additions and 5 deletions.
  1. +2 −0 builtin/fetch.c
  2. +6 −3 fetch-pack.c
  3. +4 −2 pkt-line.c
@@ -1556,7 +1556,9 @@ static int fetch_one(struct remote *remote, int argc, const char **argv, int pru

sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack);
sigchain_push(SIGPIPE, SIG_IGN);
exit_code = do_fetch(gtransport, &rs);
sigchain_pop(SIGPIPE);
refspec_clear(&rs);
transport_disconnect(gtransport);
gtransport = NULL;
@@ -191,8 +191,10 @@ static void send_request(struct fetch_pack_args *args,
if (args->stateless_rpc) {
send_sideband(fd, -1, buf->buf, buf->len, LARGE_PACKET_MAX);
packet_flush(fd);
} else
write_or_die(fd, buf->buf, buf->len);
} else {
if (write_in_full(fd, buf->buf, buf->len) < 0)
die_errno(_("unable to write to remote"));
}
}

static void insert_one_alternate_object(struct fetch_negotiator *negotiator,
@@ -1165,7 +1167,8 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,

/* Send request */
packet_buf_flush(&req_buf);
write_or_die(fd_out, req_buf.buf, req_buf.len);
if (write_in_full(fd_out, req_buf.buf, req_buf.len) < 0)
die_errno(_("unable to write request to remote"));

strbuf_release(&req_buf);
return ret;
@@ -88,13 +88,15 @@ static void packet_trace(const char *buf, unsigned int len, int write)
void packet_flush(int fd)
{
packet_trace("0000", 4, 1);
write_or_die(fd, "0000", 4);
if (write_in_full(fd, "0000", 4) < 0)
die_errno(_("unable to write flush packet"));
}

void packet_delim(int fd)
{
packet_trace("0001", 4, 1);
write_or_die(fd, "0001", 4);
if (write_in_full(fd, "0001", 4) < 0)
die_errno(_("unable to write delim packet"));
}

int packet_flush_gently(int fd)

0 comments on commit 1a02835

Please sign in to comment.
You can’t perform that action at this time.