Aha. I figured out the bug with closing and opening pipes (you have to do
it in the right order)!

Attached is a patch to the 121000 snapshot to get ExternalTransport and
ExternalParser to work correctly.

Please test the snapshot (pref. with patch) and push on it. I will try
fix up bugs ASAP so we can try to get 3.2.0b3 out this week. (fingers
crossed)

Cheers,
-Geoff
Index: ExternalParser.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htdig/ExternalParser.cc,v
retrieving revision 1.19.2.12
diff -c -3 -p -r1.19.2.12 ExternalParser.cc
*** ExternalParser.cc   2000/12/10 21:44:08     1.19.2.12
--- ExternalParser.cc   2000/12/11 04:18:37
*************** ExternalParser::parse(Retriever &retriev
*** 207,218 ****
          }
        else if(fork_result == 0) // Child process
          {
-           close(STDIN_FILENO); // Close STDIN
-           close(STDERR_FILENO); // Close STDERR
            close(STDOUT_FILENO); // Close then handle STDOUT
            dup(stdout_pipe[1]);
            close(stdout_pipe[0]);
            close(stdout_pipe[1]);
  
            // Call External Parser
            execl(currentParser.get(), currentParser.get(), path.get(),
--- 207,218 ----
          }
        else if(fork_result == 0) // Child process
          {
            close(STDOUT_FILENO); // Close then handle STDOUT
            dup(stdout_pipe[1]);
            close(stdout_pipe[0]);
            close(stdout_pipe[1]);
+           close(STDIN_FILENO); // Close STDIN
+           close(STDERR_FILENO); // Close STDERR
  
            // Call External Parser
            execl(currentParser.get(), currentParser.get(), path.get(),
Index: ExternalTransport.cc
===================================================================
RCS file: /opt/htdig/cvs/htdig3/htdig/ExternalTransport.cc,v
retrieving revision 1.1.2.5
diff -c -3 -p -r1.1.2.5 ExternalTransport.cc
*** ExternalTransport.cc        2000/12/10 21:44:08     1.1.2.5
--- ExternalTransport.cc        2000/12/11 04:18:37
*************** Transport::DocStatus ExternalTransport::
*** 128,139 ****
          }
        else if(fork_result == 0) // Child process
          {
-           close(STDIN_FILENO); // Close STDIN
-           close(STDERR_FILENO); // Close STDERR
            close(STDOUT_FILENO); // Close then handle STDOUT
            dup(stdout_pipe[1]);
            close(stdout_pipe[0]);
            close(stdout_pipe[1]);
  
            // Call External Parser
            execl(_Handler.get(), _Handler.get(), _Protocol.get(),
--- 128,139 ----
          }
        else if(fork_result == 0) // Child process
          {
            close(STDOUT_FILENO); // Close then handle STDOUT
            dup(stdout_pipe[1]);
            close(stdout_pipe[0]);
            close(stdout_pipe[1]);
+           close(STDIN_FILENO); // Close STDIN
+           close(STDERR_FILENO); // Close STDERR
  
            // Call External Parser
            execl(_Handler.get(), _Handler.get(), _Protocol.get(),
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] 
You will receive a message to confirm this. 

Reply via email to