Return-Path: Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Delivered-To: mailing list dev@apr.apache.org Received: (qmail 47449 invoked from network); 7 Jan 2001 20:51:03 -0000 Received: from www.jetnet.co.uk (root@62.172.71.4) by h31.sny.collab.net with SMTP; 7 Jan 2001 20:51:03 -0000 Received: from godzilla (194-73-188-226.btconnect.com [194.73.188.226]) (authenticated) by www.jetnet.co.uk (8.11.1/8.11.1) with ESMTP id f07Kp4s14386 for ; Sun, 7 Jan 2001 20:51:04 GMT Message-ID: <00bd01c078eb$0c7696c0$011aa8c0@godzilla> From: "David Reid" To: "APR Development List" Subject: Keeping track of socket settings... Date: Sun, 7 Jan 2001 20:47:14 -0000 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.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N [This is from a discussion on new-httpd] dean posted as follows.. the {get,set}sockopt stuff is TCP_NODELAY and CORK. those aren't terribly expensive system calls at all... but it's still tempting to clean them up. i'd say that since all sockopt calls go through APR it can keep track of the current state -- it could even defer setting TCP_NODELAY until a naked write comes along (i.e. a write which isn't part of a sendfile sequence which uses CORK). btw, the sendfile code for linux does a bunch of "if (corked)" tests -- conditionals like that can slow stuff down especially since the most common usage is going to be one sendfile per response, and it'll always have headers and always be corked. it doesn't hurt to always cork. F_GETFL followed by F_SETFL -- i'm not aware of any case where we have to do the F_GETFL. we know we want O_RDWR|O_NONBLOCK and can set it directly. worst case scenario is that we can figure something like this out at config time (or maybe have a hint or whatever so that on linux, solaris and probably freebsd we just set O_RDWR|O_NONBLOCK directly). i haven't looked into what's causing the read/EAGAIN -- the response here had "Connection: close", and there should be no need to read before going into lingering close. Some of this is apr specific, so ... It seems like a good idea to keep track of what we have set as the socket options. Should we simply use a variable (apr_int32_t umask for example) and check the bits? Would this work across all platforms? Bill? Brian? david