Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 37222 invoked from network); 2 Feb 2011 19:56:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Feb 2011 19:56:31 -0000 Received: (qmail 56212 invoked by uid 500); 2 Feb 2011 19:56:30 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 56124 invoked by uid 500); 2 Feb 2011 19:56:30 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 56113 invoked by uid 99); 2 Feb 2011 19:56:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 19:56:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fdmanana@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 19:56:22 +0000 Received: by fxm5 with SMTP id 5so341198fxm.11 for ; Wed, 02 Feb 2011 11:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=REhPctKke3ZFUUkrk4XgnH4PAIgNiQ0KIFwWUXaubkk=; b=inG/VycSGIemi/uCQUFtMvYWzDIiQh7Wqdh8adETuXlacFvoV0UEn3rzYTyHjI69BF GtWYu+r/rjgit3nqNb1d7zJr9RFgNsXG1hJg3LittJsXp6Dpk0RJP676sHtCIhejWqWf qp6u1fiWgD25Jp9LyUCdDuvdH/yfUyY1flXkw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=A3mcImnEUWcCPnadLpA51x0QBPh4mja7+PPOIeoDgF1tApp0GEDZxbe+tkWyK5WGMa tRTF4I70/+bcKwRUMWEDDxTjlNSu9pwnOIDM8dPwJAid6s8pdlMaQ2AP6u3QXYK0anDE Vc3YwR1FOroL7ERq1LeRX12ZS4r21KLoI6a10= MIME-Version: 1.0 Received: by 10.223.97.2 with SMTP id j2mr1030115fan.23.1296676561466; Wed, 02 Feb 2011 11:56:01 -0800 (PST) Sender: fdmanana@gmail.com Received: by 10.223.3.13 with HTTP; Wed, 2 Feb 2011 11:56:01 -0800 (PST) In-Reply-To: References: <20110202102644.2A3062388A3C@eris.apache.org> Date: Wed, 2 Feb 2011 11:56:01 -0800 X-Google-Sender-Auth: uJ2w5Hnj4l9SIofnfK4P5qW20rE Message-ID: Subject: Re: svn commit: r1066404 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Feb 2, 2011 at 11:37 AM, Paul Davis w= rote: > when is_list_of_lists? Right In fact the clause [User, Pass] can also go away. Just having [User | PassParts] -> {User, string:join(PassPartss, ":")} should do it > > On Wed, Feb 2, 2011 at 2:36 PM, Robert Newson w= rote: >> Ack, thanks. will fix (again) >> >> On Wed, Feb 2, 2011 at 7:17 PM, Filipe David Manana wrote: >>> Robert, >>> >>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0[User | Pass] -> >>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0[User | Pass] when is_list(Pass) -> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {User, string:join(Pass, ":"= )}; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 [User] -> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {User, ""}; >>> >>> "Pass" will always be a list. The clause with a single element match >>> is the redundant one. Calling string:join(":") on an emply list/string >>> will return an empty list/string, so the [User] clause could go away. >>> >>> cheers >>> >>> On Wed, Feb 2, 2011 at 2:26 AM, =C2=A0 wrote: >>>> Author: rnewson >>>> Date: Wed Feb =C2=A02 10:26:43 2011 >>>> New Revision: 1066404 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=3D1066404&view=3Drev >>>> Log: >>>> fix clause warning introduced with COUCHDB-969 >>>> >>>> Modified: >>>> =C2=A0 =C2=A0couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl >>>> >>>> Modified: couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl >>>> URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/c= ouch_httpd_auth.erl?rev=3D1066404&r1=3D1066403&r2=3D1066404&view=3Ddiff >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl (original) >>>> +++ couchdb/branches/1.1.x/src/couchdb/couch_httpd_auth.erl Wed Feb = =C2=A02 10:26:43 2011 >>>> @@ -53,7 +53,7 @@ basic_name_pw(Req) -> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 [User, Pass] -> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {User, Pass}; >>>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0[User | Pass] -> >>>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0[User | Pass] when is_list(Pass) -> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {User, string:join(Pass, ":"= )}; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 [User] -> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {User, ""}; >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Filipe David Manana, >>> fdmanana@gmail.com, fdmanana@apache.org >>> >>> "Reasonable men adapt themselves to the world. >>> =C2=A0Unreasonable men adapt the world to themselves. >>> =C2=A0That's why all progress depends on unreasonable men." >>> >> > --=20 Filipe David Manana, fdmanana@gmail.com, fdmanana@apache.org "Reasonable men adapt themselves to the world. =C2=A0Unreasonable men adapt the world to themselves. =C2=A0That's why all progress depends on unreasonable men."