Thread (29 messages) 29 messages, 4 authors, 2016-07-15

Re: [PATCH v14 15/21] index-helper: kill mode

From: Johannes Schindelin <hidden>
Date: 2016-07-06 08:24:14

Hi Dave,

On Sun, 3 Jul 2016, David Turner wrote:
quoted hunk ↗ jump to hunk
@@ -357,10 +359,29 @@ static const char * const usage_text[] = {
 	NULL
 };
 
+static void request_kill(void)
+{
+	int fd = unix_stream_connect(git_path("index-helper.sock"));
+
+	if (fd >= 0) {
+		write_in_full(fd, "die", 4);
I believe that this is incorrect. When I interrupt t7900 after the 3rd
test case, it says

	fatal: protocol error: bad line length character: die

twice, suggesting that this write_in_full() actually needs to be a
packet_write(fd, "die") instead, seeing as loop() uses the packet_read()
call to read the messages.

BTW I am in the middle of trying to abstract out a "simple server" that
will allow me to back the inter-process communication by a pure Windows
solution (named pipes) instead of the Unix sockets. It turns out to be
much more difficult than I hoped: the code is really relying on Unix
sockets currently.

Will keep you posted,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help