From patchwork Wed Dec 2 14:04:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3693 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CmLLZ5WMFz3wpp for ; Wed, 2 Dec 2020 14:04:22 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CmLLY2YJ2z12D; Wed, 2 Dec 2020 14:04:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CmLLY1Qc0z2y1V; Wed, 2 Dec 2020 14:04:21 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CmLLW2R6Yz2xFj for ; Wed, 2 Dec 2020 14:04:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4CmLLT56TZzlp; Wed, 2 Dec 2020 14:04:16 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1606917858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HNpToX93fy6IrMG9TKkhkUGj8m1ldXrkGZPh8WjDHSw=; b=h4HN7rrEo0QYM8pBUD98sHiq7X+3Ryfk5Yf3XYYBRNipK6Nj6FgThqDu+lHMTI1HNHPN75 bBYUH0clxTyZktBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1606917858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HNpToX93fy6IrMG9TKkhkUGj8m1ldXrkGZPh8WjDHSw=; b=qolpVYSINObeEvWTZ5g5ZaMzRZ0BNl0zFijTAwvWqUlD6iI8Hg/wGS9gjblbojluocnUOI 6squZktGAaGgL1UixN6BlH8PUodMjFSOgPqIDqaT0nXtobDX38eSTauojZB6Ch1eUVMLC2 BFLcXMtAhiow7lau1PxXO2XIV+/RlXRQD1H7+EC847pct0qCPXVx6tKn2Sm5bXu4P/u1Iq NrXr4R9HBq5te8LaSGClvzCq9Gz+2eMwwk+qD2fVq025JkyR3IKOzxNuucgUj+oYknthxc pfUhG9wVVXrOsaF0tnBDSrXv7BeanVnwyCAFCXpYCGs79byE/9YJKa9e1/nrhA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] location-functions.pl: Remove accidently keept 2nd DB init call. Date: Wed, 2 Dec 2020 15:04:08 +0100 Message-Id: <20201202140408.6706-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" The get_full_country_name() function had an accidenlty and not longer required call of the DB init function. This is a waste of memory and a known problem, especially on systems with less than 1GB of RAM, where the application which uses libloc in such a redundant way crashes. Signed-off-by: Stefan Schantl --- config/cfgroot/location-functions.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/cfgroot/location-functions.pl b/config/cfgroot/location-functions.pl index b7465c5ef..fb97eb589 100644 --- a/config/cfgroot/location-functions.pl +++ b/config/cfgroot/location-functions.pl @@ -163,9 +163,6 @@ sub get_full_country_name($) { # Grab location name from hash. $name = $not_iso_3166_location{$code}; } else { - # Init libloc database connection. - my $db_handle = &init(); - # Get the country name by using the location module. $name = &Location::get_country_name($db_handle, $code); }