Skip to content

Commit

Permalink
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into mai…
Browse files Browse the repository at this point in the history
…nt-1.7.4

* js/maint-send-pack-stateless-rpc-deadlock-fix:
  sideband_demux(): fix decl-after-stmt
  send-pack: unbreak push over stateless rpc
  send-pack: avoid deadlock when pack-object dies early
  • Loading branch information
Junio C Hamano committed May 26, 2011
2 parents 4201472 + 1c1f046 commit 34df9fe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions builtin/send-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,11 @@ static void print_helper_status(struct ref *ref)

static int sideband_demux(int in, int out, void *data)
{
int *fd = data;
int ret = recv_sideband("send-pack", fd[0], out);
int *fd = data, ret;
#ifdef NO_PTHREADS
close(fd[1]);
#endif
ret = recv_sideband("send-pack", fd[0], out);
close(out);
return ret;
}
Expand Down Expand Up @@ -339,6 +342,8 @@ int send_pack(struct send_pack_args *args,
if (pack_objects(out, remote_refs, extra_have, args) < 0) {
for (ref = remote_refs; ref; ref = ref->next)
ref->status = REF_STATUS_NONE;
if (args->stateless_rpc)
close(out);
if (use_sideband)
finish_async(&demux);
return -1;
Expand Down

0 comments on commit 34df9fe

Please sign in to comment.