apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r583421 - in /apr/apr/trunk: CHANGES threadproc/win32/proc.c
Date Wed, 10 Oct 2007 10:38:53 GMT
Author: trawick
Date: Wed Oct 10 03:38:39 2007
New Revision: 583421

URL: http://svn.apache.org/viewvc?rev=583421&view=rev
Log:
apr_procattr_io_set() on Windows: Set pipe handles non-blocking as
appropriate based on the input parameters.

PR:           43522
Submitted by: Eric Covener <covener gmail.com>
Reviewed by:  trawick

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/threadproc/win32/proc.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=583421&r1=583420&r2=583421&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Wed Oct 10 03:38:39 2007
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.3.0
 
+  *) apr_procattr_io_set() on Windows: Set pipe handles non-blocking as
+     appropriate based on the input parameters.  PR 43522.
+     [Eric Covener <covener gmail.com>]
+
   *) apr_file_write() on Windows: Fix return code when writing to a non-
      blocking pipe would have blocked.  PR 43563. 
      [Eric Covener <covener gmail.com>]

Modified: apr/apr/trunk/threadproc/win32/proc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/win32/proc.c?rev=583421&r1=583420&r2=583421&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/win32/proc.c (original)
+++ apr/apr/trunk/threadproc/win32/proc.c Wed Oct 10 03:38:39 2007
@@ -95,27 +95,75 @@
 
         if (in == APR_NO_FILE)
             attr->child_in = &no_file;
-        else
+        else { 
             stat = apr_create_nt_pipe(&attr->child_in, &attr->parent_in,
                                       in, attr->pool);
+            if (stat == APR_SUCCESS) { 
+                switch (in) { 
+                    case APR_FULL_BLOCK:
+                        break;
+                    case APR_READ_BLOCK:
+                        apr_file_pipe_timeout_set(attr->parent_in, 0);
+                        break;
+                    case APR_WRITE_BLOCK:
+                        apr_file_pipe_timeout_set(attr->child_in, 0);
+                        break;
+                    default:
+                        apr_file_pipe_timeout_set(attr->child_in, 0);
+                        apr_file_pipe_timeout_set(attr->parent_in, 0);
+                }
+            }
+        }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_in);
     }
     if (out && stat == APR_SUCCESS) {
         if (out == APR_NO_FILE)
             attr->child_out = &no_file;
-        else
+        else { 
             stat = apr_create_nt_pipe(&attr->parent_out, &attr->child_out,
                                       out, attr->pool);
+            if (stat == APR_SUCCESS) { 
+                switch (out) {
+                    case APR_FULL_BLOCK:
+                        break;
+                    case APR_PARENT_BLOCK:
+                        apr_file_pipe_timeout_set(attr->child_out, 0);
+                        break;
+                    case APR_CHILD_BLOCK:
+                        apr_file_pipe_timeout_set(attr->parent_out, 0);
+                        break;
+                    default:
+                        apr_file_pipe_timeout_set(attr->child_out, 0);
+                        apr_file_pipe_timeout_set(attr->parent_out, 0);
+                }
+            }
+        }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_out);
     }
     if (err && stat == APR_SUCCESS) {
         if (err == APR_NO_FILE)
             attr->child_err = &no_file;
-        else
+        else { 
             stat = apr_create_nt_pipe(&attr->parent_err, &attr->child_err,
                                       err, attr->pool);
+            if (stat == APR_SUCCESS) { 
+                switch (err) {
+                    case APR_FULL_BLOCK:
+                        break;
+                    case APR_PARENT_BLOCK:
+                        apr_file_pipe_timeout_set(attr->child_err, 0);
+                        break;
+                    case APR_CHILD_BLOCK:
+                        apr_file_pipe_timeout_set(attr->parent_err, 0);
+                        break;
+                    default:
+                        apr_file_pipe_timeout_set(attr->child_err, 0);
+                        apr_file_pipe_timeout_set(attr->parent_err, 0);
+                }
+            }
+        }
         if (stat == APR_SUCCESS)
             stat = apr_file_inherit_unset(attr->parent_err);
     }



Mime
View raw message