Merge branch 'np/maint-sideband-favor-status'
* np/maint-sideband-favor-status: give priority to progress messages
This commit is contained in:
@ -132,7 +132,6 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct pollfd pfd[2];
|
struct pollfd pfd[2];
|
||||||
ssize_t processed[2] = { 0, 0 };
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
pfd[0].fd = fd1[0];
|
pfd[0].fd = fd1[0];
|
||||||
@ -147,15 +146,14 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (pfd[0].revents & POLLIN)
|
|
||||||
/* Data stream ready */
|
|
||||||
processed[0] = process_input(pfd[0].fd, 1);
|
|
||||||
if (pfd[1].revents & POLLIN)
|
if (pfd[1].revents & POLLIN)
|
||||||
/* Status stream ready */
|
/* Status stream ready */
|
||||||
processed[1] = process_input(pfd[1].fd, 2);
|
if (process_input(pfd[1].fd, 2))
|
||||||
/* Always finish to read data when available */
|
continue;
|
||||||
if (processed[0] || processed[1])
|
if (pfd[0].revents & POLLIN)
|
||||||
continue;
|
/* Data stream ready */
|
||||||
|
if (process_input(pfd[0].fd, 1))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (waitpid(writer, &status, 0) < 0)
|
if (waitpid(writer, &status, 0) < 0)
|
||||||
error_clnt("%s", lostchild);
|
error_clnt("%s", lostchild);
|
||||||
|
@ -308,6 +308,23 @@ static void create_pack_file(void)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (0 <= pe && (pfd[pe].revents & (POLLIN|POLLHUP))) {
|
||||||
|
/* Status ready; we ship that in the side-band
|
||||||
|
* or dump to the standard error.
|
||||||
|
*/
|
||||||
|
sz = xread(pack_objects.err, progress,
|
||||||
|
sizeof(progress));
|
||||||
|
if (0 < sz)
|
||||||
|
send_client_data(2, progress, sz);
|
||||||
|
else if (sz == 0) {
|
||||||
|
close(pack_objects.err);
|
||||||
|
pack_objects.err = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
goto fail;
|
||||||
|
/* give priority to status messages */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (0 <= pu && (pfd[pu].revents & (POLLIN|POLLHUP))) {
|
if (0 <= pu && (pfd[pu].revents & (POLLIN|POLLHUP))) {
|
||||||
/* Data ready; we keep the last byte to ourselves
|
/* Data ready; we keep the last byte to ourselves
|
||||||
* in case we detect broken rev-list, so that we
|
* in case we detect broken rev-list, so that we
|
||||||
@ -345,21 +362,6 @@ static void create_pack_file(void)
|
|||||||
if (sz < 0)
|
if (sz < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (0 <= pe && (pfd[pe].revents & (POLLIN|POLLHUP))) {
|
|
||||||
/* Status ready; we ship that in the side-band
|
|
||||||
* or dump to the standard error.
|
|
||||||
*/
|
|
||||||
sz = xread(pack_objects.err, progress,
|
|
||||||
sizeof(progress));
|
|
||||||
if (0 < sz)
|
|
||||||
send_client_data(2, progress, sz);
|
|
||||||
else if (sz == 0) {
|
|
||||||
close(pack_objects.err);
|
|
||||||
pack_objects.err = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finish_command(&pack_objects)) {
|
if (finish_command(&pack_objects)) {
|
||||||
|
Reference in New Issue
Block a user