rbb 00/12/21 21:56:38
Modified: src/buckets ap_buckets_pipe.c ap_buckets_socket.c
Log:
When there is no data at the end of a dynamic lengthed bucket, we have
to return APR_EOF. Otherwise, we will not know when we have hit the end
of the bucket.
Submitted by: Jon Travis <[EMAIL PROTECTED]>
Reviewed by: Ryan Bloom
Revision Changes Path
1.25 +2 -2 apr-util/src/buckets/ap_buckets_pipe.c
Index: ap_buckets_pipe.c
===================================================================
RCS file: /home/cvs/apr-util/src/buckets/ap_buckets_pipe.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ap_buckets_pipe.c 2000/12/21 18:06:15 1.24
+++ ap_buckets_pipe.c 2000/12/22 05:56:37 1.25
@@ -56,7 +56,6 @@
#include "ap_buckets.h"
#include <stdlib.h>
-/* XXX: We should obey the block flag */
static apr_status_t pipe_read(ap_bucket *a, const char **str,
apr_size_t *len, ap_read_type block)
{
@@ -106,8 +105,9 @@
b = ap_bucket_create_pipe(p);
AP_BUCKET_INSERT_AFTER(a, b);
}
- else {
+ else if (rv == APR_EOF) {
apr_close(p);
+ return (block == AP_NONBLOCK_READ) ? APR_EOF : APR_SUCCESS;
}
return APR_SUCCESS;
}
1.14 +3 -0 apr-util/src/buckets/ap_buckets_socket.c
Index: ap_buckets_socket.c
===================================================================
RCS file: /home/cvs/apr-util/src/buckets/ap_buckets_socket.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ap_buckets_socket.c 2000/12/21 18:06:15 1.13
+++ ap_buckets_socket.c 2000/12/22 05:56:37 1.14
@@ -109,6 +109,9 @@
b = ap_bucket_create_socket(p);
AP_BUCKET_INSERT_AFTER(a, b);
}
+ else if (rv == APR_EOF && block == AP_NONBLOCK_READ) {
+ return APR_EOF;
+ }
return APR_SUCCESS;
}