Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 37765 invoked by uid 500); 22 Jun 2000 18:09:01 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 37746 invoked from network); 22 Jun 2000 18:08:58 -0000 Message-ID: <016901bfdc75$7f224560$c1e01b09@raleigh.ibm.com> From: "Bill Stoddard" To: References: Subject: Re: APR_EOF? Date: Thu, 22 Jun 2000 14:12:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Forget for now my speculation that maybe we could combine sockets with pipe/file i/o. Just focus on sharing pipe/file code between platforms. > > On a related topic, is there any reason why we can't consolidate the > > ap_read code across platforms? ap_read must: > > > > 1. handle the ungetchar > > 2. handle reads (non-blocking, non-blocking with timeouts and blocking) > > 3. buffered i/o > > 4. 1 thru 3 for both files and pipes > > > > Most of this code is identical across Unix and Windows which implies > > we should create a common ap_read() implementation which calls a > > platform specific os_read_with_timeout(). os_read_with_timeout() is > > where the platform specific code resides. os_read_with_timeout() would > > need to know if it is handling a pipe or a file. Right now, each > > platform is handling the ungetchar, buffered reads, etc. differently, > > which is not good. > > I just looked at the ap_read code. Most of it is not common across > platforms. Indeed. ap_read() semantics are different for each platform, which is precisely the problem. > One of the reasons that we have re-written this code, is so > that Windows can use their native functions. os_read_with_timeout() implements the lowlevel platform specific read with timeout. All very platform specific. The code to handle ungetchar, i/o buffering, etc can all be identical. Watch what I do with ap_read on Windows in the next week or so (it doesn't do timeout now). The only crufty thing that comes to mind is the implementation of ap_file_t. Yes, it would need to include #ifdef YOUR_PLATFORM whatnot. This may be a worthwhile tradeoff in certain circumstances if it helps keep APR semantics the same across multiple implementations. Right now it's all over the floor. Bill