) apache2_ap_get_client_block (request_rec *r, char *buffer,
+apr_size_t bufsiz)
+{
+apr_status_t rv;
+apr_bucket_brigade *bb;
+int loop = 1;
+int origBufSize = bufsiz;
+
+if (r-remaining 0 || (!r-read_chunked r-remaining == 0)) {
+return 0;
+}
+
+bb = apr_brigade_create(r-pool, r-connection-bucket_alloc);
+if (bb == NULL) {
+r-connection-keepalive = AP_CONN_CLOSE;
+return -1;
+}
+
+/* we need to loop until the input filters (if any) give us data */
+while (loop) {
+rv = ap_get_brigade(r-input_filters, bb, AP_MODE_READBYTES,
+APR_BLOCK_READ, bufsiz);
+
+/* We lose the failure code here. This is why ap_get_client_block
should
+ * not be used.
+ */
+if (rv != APR_SUCCESS) {
+/* if we actually fail here, we want to just return and
+ * stop trying to read data from the client.
+ */
+r-connection-keepalive = AP_CONN_CLOSE;
+apr_brigade_destroy(bb);
+return -1;
+}
+
+/* If this fails, it means that a filter is written incorrectly and
that
+ * it needs to learn how to properly handle APR_BLOCK_READ requests by
+ * returning data when requested.
+ */
+AP_DEBUG_ASSERT(!APR_BRIGADE_EMPTY(bb));
+
+/* Check to see if EOS in the brigade.
+ *
+ * If so, we have to leave a nugget for the *next* ap_get_client_block
+ * call to return 0.
+ */
+if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
+if (r-read_chunked) {
+r-remaining = -1;
+} else {
+r-remaining = 0;
+}
+}
+
+rv = apr_brigade_flatten(bb, buffer, bufsiz);
+if (rv != APR_SUCCESS) {
+apr_brigade_destroy(bb);
+return -1;
+}
+
+/* XXX yank me? */
+r-read_length += bufsiz;
+
+/* it is possible that the entire bucket brigade is exhausted, but no
data
+ * has been produced by the input filter (mod_deflate, for example)
+ * in this scenario, we really need to keep looping
+ */
+if (bufsiz != 0 || r-remaining = 0) {
+loop = 0;
+apr_brigade_destroy(bb);
+} else {
+if (bufsiz == 0) {
+bufsiz = origBufSize;
+}
+}
+
+}
+
+return bufsiz;
+}
-Original Message-
From: Murphey McCloy [mailto:mmcc...@webroot.com]
Sent: Fri 8/21/2009 10:33 AM
To: axis-c-user@ws.apache.org
Subject: Questions about using mod_deflate
Hello,
I am hoping someone might be able to help me out with a problem I am having. I
am using Axis2/C 1.6 with http 2.2.3 on CentOS 5.3. I am attempting to use
mod_deflate to decompress/compress my requests and responses. It is handling
compressing my responses just fine, but the requests are failing. It appears
to me that the decompression of the requests prematurely ends after the gzip
header is validated. Has anyone actually set axis2c and apache up to
decompress incoming requests that could give me some guidance?
Thanks,
Murphey
winmail.dat