updxlrator: show hostaddr in debuglog

Message ID 6bd47129-c3da-98db-440e-8c6397f67e1c@mail.com
State Dropped
Headers
Series updxlrator: show hostaddr in debuglog |

Commit Message

Justin Luth Dec. 30, 2017, 6:41 p.m. UTC
  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  <jluth@mail.com>
---
  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 &");
  

Comments

Michael Tremer Dec. 31, 2017, 1:29 a.m. UTC | #1
Hi,

this patch makes sense, but your email client seemed to have wrapped the lines.

I will try to fix this this time and get back in case that didn't work, but
maybe you can have a look what you can change in the email client for next time.

Best,
-Michael

On Sat, 2017-12-30 at 10:41 +0300, Justin Luth wrote:
> 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  <jluth@mail.com>
> ---
>   config/updxlrator/updxlrator | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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/$vendor
> id/$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");
>           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 &");
  

Patch

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");