From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Help understanding the URL code Date: Wed, 06 Apr 2016 13:34:44 +0200 Message-ID: References: <5703DBB2.1030903@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1459942513 12709 80.91.229.3 (6 Apr 2016 11:35:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Apr 2016 11:35:13 +0000 (UTC) Cc: Emacs developers To: =?iso-8859-1?Q?Cl=E9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 06 13:35:03 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1anlji-0003Zd-0q for ged-emacs-devel@m.gmane.org; Wed, 06 Apr 2016 13:35:02 +0200 Original-Received: from localhost ([::1]:42478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anljd-0004GW-UD for ged-emacs-devel@m.gmane.org; Wed, 06 Apr 2016 07:34:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anljZ-0004Fl-LO for emacs-devel@gnu.org; Wed, 06 Apr 2016 07:34:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anljU-0006rF-Li for emacs-devel@gnu.org; Wed, 06 Apr 2016 07:34:53 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:41186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anljU-0006rB-3x for emacs-devel@gnu.org; Wed, 06 Apr 2016 07:34:48 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1anljR-0004AH-2Q; Wed, 06 Apr 2016 13:34:47 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+/v5OPEr+/f1qV2XS yM38+fn18fI3JzM8iJxxAAACbElEQVQ4jV1Uy27kIBBsWTt7bxGJq8Uuc0dY8T1DnOvIGjhHGZs7 ciR+f6uxs5ld5iHcRVVXF5IphCn/s9aY8xICZamvRB3ty5i2/Uk5BB8m0x91SsKZTQOgNkutk++P Cc8xpgPodxUh2rm3vT0fAO2MznQxrcnEDlIm5WsrG6F0xsQYbQSQ8vxlp1nobAZ0Jligb7PtRMo7 IIfMA9CJFgDQjZ3pEekMGJG6vn8kNB8YcLX2ejz3zdouhjnyukITTmdjLKZAB6SXKIQ91PSQ72wB YBOvkkVHLVcjU9K0A/1RIfMVzQ6ss2nrb/SnZUi0tkv7LhLFvKbp3AComRlucEEnMRHn4UwfSSoR Vg28IiUcSWGwFBNuqTerQNC0+SpzDCdKMRhMtUqXm+lWRDvP9rkxJPmTtL0d+ccwRGQ1vXezXRJ0 lhRfyKaYsgAxvIZpuizhdbnf1tf89hLt7x2YwjS8hXvRl8tLCPU55ZsAOQwhKP35VrE2X+rmvH+K lJdRKrW0/8pct7Hy55Xuuh6rHDtdmJ/eaXHM2HEtykmpsPNODVdavHesgH4txQwAjAs7zZ7lrC7S i5X3AvimwKxZV6254hSADwA4yAWtUSxgoe6c/6C7AAU9KurCY5FSDfBKiZZzcKHkyYnU3Su3OeUK fow/dvj4JuXEIjgKEQByGEg1QOkqjrnArWsG3c5gZNOmB3WsGtyRd6DZqXrcxC58Fd/ssh6hVfC8 tR4w6xtjxGAg+BEtNsV6K2LrHVKSuPT0qnpED69lH7DqOkqiSsk8mxdTaqVfjrUqTuMW/AB5fxnk lZDpjFfQsiz5//UHOuL02oaBN3MAAAAASUVORK5CYII= In-Reply-To: <5703DBB2.1030903@gmail.com> (=?iso-8859-1?Q?=22Cl=E9ment?= Pit--Claudel"'s message of "Tue, 5 Apr 2016 16:37:22 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202764 Archived-At: Cl=E9ment Pit--Claudel writes: > Thus IIUC this bit of code will return different values depending on > whether the url package had already been loaded before or whether it > was loaded through url-retrieve-synchronously being autoloaded. Is > that right? Yes, you're right, and that doesn't make much sense. Your patch looks good, but perhaps this part could be changed a bit: [...] > + (format "User-Agent: %s\r\n" > + (string-trim > + (cond > + ((functionp url-user-agent) (funcall url-user-agent)) > + ((stringp url-user-agent) url-user-agent) > + (t (url-http--user-agent-default-string))))))) It should be possible to not have a User-Agent header at all. nil as a value to `url-user-agent' would be the obvious choice, and `default' could be the value to signal using `url-http--user-agent-default-string'. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no