[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldsync-hackers] network sync and 404 missing daemon header in dump conduit



Hi!

Coldsync running as a inetd daemon mode.
Dump conduit always return 404 missing daemon header

Log:
Running post-dump conduits for "Dokumenty".
...
spawn_conduit: inpipe == 0, 5
spawn_conduit: tochild fd == 5
spawn_conduit: outpipe == 6, 7
spawn_conduit: fromchild fd == 6
Blocking SIGCHLD.
Conduit PID == 347
Unblocking SIGCHLD.
Blocking SIGCHLD.
Header[0] Daemon:coldsync
...
Unblocking SIGCHLD.
>>> Daemon: coldsync
writing chunk [Daemon: coldsync
] (17)
...
Unblocking SIGCHLD.
find_in_path: returning [/home/and/presell/current/presell-dbf]
404 Missing Daemon header
run_conduit: select() returned 1
Child has printed to stdout.
Blocking SIGCHLD.
cond_readline: About to select()
cond_readline: select() returned 1
Child has written something
cond_readstatus: <<< "404 Missing Daemon header"
Missing Daemon header
Unblocking SIGCHLD.
run_conduit: got status 404
Got a SIGCHLD
Conduit is no longer running.
Conduit exited with status 255


This is my patch resolving this problem:

--- conduit.c.orig	2004-06-22 09:52:58.000000000 +0200
+++ conduit.c	2004-06-22 00:04:35.000000000 +0200
@@ -1829,7 +1829,8 @@
 		Perror("dup2(stdin)");
 		exit(1);
 	}
-	close(inpipe[0]);
+	if (inpipe[0] != STDIN_FILENO)
+		close(inpipe[0]);

 	/* Dup stdout to the pipe */
 	if ((err = dup2(outpipe[1], STDOUT_FILENO)) < 0)


Log after patching: Running post-dump conduits for "Dokumenty". ... spawn_conduit: inpipe == 0, 5 spawn_conduit: tochild fd == 5 spawn_conduit: outpipe == 6, 7 spawn_conduit: fromchild fd == 6 Blocking SIGCHLD. Conduit PID == 320 Unblocking SIGCHLD. Blocking SIGCHLD. Header[0] Daemon:coldsync ... Unblocking SIGCHLD. >>> Daemon: coldsync writing chunk [Daemon: coldsync ] (17) ... Unblocking SIGCHLD. find_in_path: returning [/home/and/presell/current/presell-dbf] run_conduit: select() returned 1 Child has printed to stdout. Blocking SIGCHLD. cond_readline: About to select() cond_readline: select() returned 1 Child has written something cond_readstatus: <<< "011 DUMP ****** BAZA - Dokumenty ******" DUMP ****** BAZA - Dokumenty ****** Unblocking SIGCHLD. run_conduit: got status 11 Got a SIGCHLD Conduit is no longer running. Conduit exited with status 0

and Dump work as expected

regards
Andrzej Dzik
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.