From d23079b62bebfc7c6fcd7879b8a64d8e7b20666b Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 17 Apr 2006 14:51:36 +0000 Subject: [PATCH] ap_get_client_block returns -1 on error.. detecting git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@695 9efc2488-bf62-4759-914b-345cdb29e865 --- src/gateway/apachetools.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gateway/apachetools.c b/src/gateway/apachetools.c index 7f80f8f..89db971 100644 --- a/src/gateway/apachetools.c +++ b/src/gateway/apachetools.c @@ -33,19 +33,19 @@ string_array* apacheParseParms(request_rec* r) { long bread; while( (bread = ap_get_client_block(r, body, 1024)) ) { + + if(bread == -1) { + osrfLogInfo(OSRF_LOG_MARK, "ap_get_client_block(): returned error, exiting POST reader"); + break; + } + buffer_add( buffer, body ); memset(body,0,1025); osrfLogDebug(OSRF_LOG_MARK, "gateway read %d bytes: %d bytes of data so far", bread, buffer->n_used); - /* this seems unnecessary since ap_get_client_block is supposed - * to return 0 when no data is read, but somehow we are getting - * here with 0 bytes of data in the buffer */ - if(buffer->n_used == 0) { - osrfLogInfo(OSRF_LOG_MARK, "buffer->n_used == 0 but we're in the read loop..."); - break; - } + if(buffer->n_used == 0) break; if(buffer->n_used > APACHE_TOOLS_MAX_POST_SIZE) { osrfLogError(OSRF_LOG_MARK, "gateway received POST larger " -- 2.11.0