apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1523613 - /apr/apr/trunk/test/sendfile.c
Date Mon, 16 Sep 2013 12:47:06 GMT
Author: trawick
Date: Mon Sep 16 12:47:06 2013
New Revision: 1523613

URL: http://svn.apache.org/r1523613
Log:
report an error if the client couldn't read stdout from the server within a couple of seconds

Modified:
    apr/apr/trunk/test/sendfile.c

Modified: apr/apr/trunk/test/sendfile.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/sendfile.c?rev=1523613&r1=1523612&r2=1523613&view=diff
==============================================================================
--- apr/apr/trunk/test/sendfile.c (original)
+++ apr/apr/trunk/test/sendfile.c Mon Sep 16 12:47:06 2013
@@ -479,12 +479,16 @@ static int client(apr_pool_t *p, client_
         char responsebuf[1024];
         int exitcode;
 
+        rv = apr_file_pipe_timeout_set(server.out, apr_time_from_sec(2));
+        if (rv != APR_SUCCESS) {
+            aprerr("apr_file_pipe_timeout_set()", rv);
+        }
         nbytes = sizeof(responsebuf);
         rv = apr_file_read(server.out, responsebuf, &nbytes);
-        if (rv == APR_SUCCESS) {
-            printf("%.*s", (int)nbytes, responsebuf);
+        if (rv != APR_SUCCESS) {
+            aprerr("apr_file_read() messages from server", rv);
         }
-
+        printf("%.*s", (int)nbytes, responsebuf);
         rv = apr_proc_wait(&server, &exitcode, &exitwhy, APR_WAIT);
         if (rv != APR_CHILD_DONE) {
             aprerr("apr_proc_wait() (expected APR_CHILD_DONE)", rv);



Mime
View raw message