From patchwork Sat Dec 30 18:41:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Justin Luth X-Patchwork-Id: 1588 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id C29BE60D8E for ; Sat, 30 Dec 2017 08:42:23 +0100 (CET) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id B63A3BAA; Sat, 30 Dec 2017 08:42:22 +0100 (CET) Received: from mout.gmx.com (mout.gmx.com [74.208.4.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mail.gmx.com", Issuer "thawte SSL CA - G2" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id DAD4EB83 for ; Sat, 30 Dec 2017 08:42:18 +0100 (CET) Received: from [192.168.3.1] ([41.79.25.253]) by mail.gmx.com (mrgmxus002 [74.208.5.15]) with ESMTPSA (Nemesis) id 0LyVtY-1eySaJ2LJO-015uhb for ; Sat, 30 Dec 2017 08:42:06 +0100 To: development@lists.ipfire.org From: Justin Luth Subject: [PATCH] updxlrator: show hostaddr in debuglog Message-ID: <6bd47129-c3da-98db-440e-8c6397f67e1c@mail.com> Date: Sat, 30 Dec 2017 10:41:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K0:trjuYjTg+klOkf76qHGaKVyEVIM73iq/L84teoAROme7MaaCERZ aT1JCFBWixT6e+x0YhMj8uKYP3W9Tq8HlNmcHxrPjcK9UriIh/gyy6XJ8NuVVF77XB3DLLD U3yGluLASjMzGvK/ZgOh2oSFPG0FdunGntTYHmksZywkpzorjT5FPiaOJeXVNWN9CFnvMiC qjDlWbvKFQf0qK6OQ4aNA== X-UI-Out-Filterresults: notjunk:1; V01:K0:jHBXEyALQkU=:DYMUu/ZO07mwMafFKWNZdY 04+y0CKqLckJRdnpY/MAbB959wBXz3NNvMRHvRp96ZUU83mWtoFBPXiahjlJ+YNIvC2wvMqAO s6F9JfZdZH8VKoo6tzW0gSQAK0Oit0Br99iv1Zt4Mx3iNsbbj5m1ecc1QoqQF63qi6iANTD1r xQAwnzS6pBoy+PHXxTN20TTrdRSHp/CHLjQ6DrxenZgDXRpsuO6NprjL06e4fhBdQYy4xDdqL fms8B5LQj5/MB1l3TY0v0dtKbLb3vc9AVqF5bmQc7yK0o1+42G1KGngKetYAQa4FFT47qnMLL k+H7qww9MBZ/SyPqLv6/WU6ab7HJBUedfolfQpiN3evEYi4uptlEiwz/99jEY0fPyggK/ef2v skZnqBNR4pwU32YYk4l4jYsYUSL/rP8wrxv6FCJz2/gRQhxRpaPjEnO6gmAZNJIjwHCrBLcg7 mAA2mCUJ6hHDsSHva6RFRU4UYXJf2WFjkmYWKpvMgYMVRxnF9FFOf08VvXXAq+WmxLBuKnRpi FpzhXDQJcjsfsdnNCr3SwjLvDcszIXTrKk3bRrLB5a43QPBcwW6U8xPmqEwHodTIwtrBDQ0i+ ZdBhj+u2rSR8n3UWDgfK5DVK4QjnsfKCbTPIyWyslzBpcxnayCf7qxop9kLJ1bBVQa1l/B6C/ uQ3YH5dtbicLBqGqTFB2uxC4GozIwcZwOWvCriSgtUT9GzOHu+ySShU37eDGQTWxg30RZIuwt 9mgKkFQYOSJSYh6aRQkIjZVj73KG4PkY7CXFYyxHDrkuEEqGuYhl/upyakKHKjgW9L2jh1Y22 6mybMxFw23salVjQcWMbsR2pymdy3rjzD0q4efBPNwSqd62HFk= X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" There is nowhere in the debuglog any indication of which client is requesting the file that updxlrator is providing (or caching). Especially for those huge Windows 10 downloads, it is valuable to see which client is requesting them, especially when the same client requests the same download multiple times a second. This only impacts users who turn on debugging. Signed-off-by: Justin Luth  ---  config/updxlrator/updxlrator | 4 ++--  1 file changed, 2 insertions(+), 2 deletions(-)          if ((!$passive_mode) && (&diskusage($updcachedir) <= $maxusage) && ($remote_size <= &diskfree($updcachedir)) && (!-e "$updcachedir/download/$vendorid/$updfile"))          {              &debuglog("Running command $nice$apphome/bin/download $vendorid $sourceurl $cfmirror &"); diff --git a/config/updxlrator/updxlrator b/config/updxlrator/updxlrator index b728902f6..5baaaae58 100644 --- a/config/updxlrator/updxlrator +++ b/config/updxlrator/updxlrator @@ -397,7 +397,7 @@ sub check_cache         )      {          &debuglog("File exists in cache and is up to date"); -        &debuglog("Retrieving file from cache ($updsource)"); +        &debuglog("Retrieving file from cache ($updsource) for $hostaddr"); &setcachestatus("$updcachedir/$vendorid/$uuid/access.log",time); $cacheurl="http://$netsettings{'GREEN_ADDRESS'}:$http_port/updatecache/$vendorid/$uuid/$updfile";      } @@ -414,7 +414,7 @@ sub check_cache          &debuglog("Free disk space: " . &diskfree($updcachedir));          &debuglog("Disk usage: " . &diskusage($updcachedir) . "% (max. $maxusage%)");          if (-e "$updcachedir/download/$vendorid/$updfile") { &debuglog("File download/$vendorid/$updfile exists"); } -        &debuglog("Retrieving file from source ($updsource)"); +        &debuglog("Retrieving file from source ($updsource) for $hostaddr");