From owner-cvs-all Fri Jun 16 12:43:27 2000 Delivered-To: cvs-all@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id D874737B79A; Fri, 16 Jun 2000 12:43:21 -0700 (PDT) (envelope-from dcs@newsguy.com) Received: from newsguy.com (p10-dn01kiryunisiki.gunma.ocn.ne.jp [211.0.245.11]) by peach.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id EAA21312; Sat, 17 Jun 2000 04:43:12 +0900 (JST) Message-ID: <394A838A.F3417365@newsguy.com> Date: Sat, 17 Jun 2000 04:44:10 +0900 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,pt-BR,ja MIME-Version: 1.0 To: Marc Slemko Cc: John-Mark Gurney , Alfred Perlstein , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c uipc_socket2.c src/sys/syssocket.h References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Marc Slemko wrote: > > Actually, no, it should not be a generalized to be fully able to grok > all possible requests. While I agree that this sort of hardcoded gunk > isn't necessarily appropriate where it is (or even useful for > performance, outside of very constrained benchmark situations), if you > are going to add special code to the kernel, then you want to keep a > small fast path in the kernel that covers the common case. You can Look at the code. It won't matter. bcmp(..., "GET ") || bcmp(..., "POST ") Additional || conditions won't be evaluated if the previous succeed. Since the point here is avoiding context switches, the fail path is of little consequence performance-wise. If it were otherwise, a case could be made of using a BM compare instead of the straight-forward stuff above. After seeing the code, I can't see why can't userland provide the strings to be matched. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@the.great.underground.bsdconpiracy.org "He is my minion, so he doesn't need a name." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message