Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx2.public.one.com ([10.246.18.22])
	by mail6.local.one.com (Dovecot) with LMTP id cyJ3Ci2EW1m5DwAAsyOMew
	for <filtered@awaresystems.be>; Tue, 04 Jul 2017 12:35:27 +0000
X-HalOne-ID: 41507612-60b5-11e7-9a45-b82a72d88088
Received: from mail-oi0-f46.google.com (unknown [209.85.218.46])
	by mx2.public.one.com (Halon) with ESMTPS
	id 41507612-60b5-11e7-9a45-b82a72d88088;
	Tue, 04 Jul 2017 12:35:26 +0000 (UTC)
Received: by mail-oi0-f46.google.com with SMTP id p188so102331441oia.0
        for <filtered@awaresystems.be>; Tue, 04 Jul 2017 05:35:26 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :mime-version:date:from:to:in-reply-to:references:message-id
         :user-agent:subject:precedence:list-id:list-unsubscribe:list-archive
         :list-post:list-help:list-subscribe:content-transfer-encoding:sender
         :errors-to;
        bh=2HxFOJcS4wi9mKludcEA3sOVi761fAge3vnLNAtnsSg=;
        b=Vh0BPTNwkZes7L+70qya+xQBb/95cGs2Q66ZI/UmINn13oQ1E0odxoyULv6dSoC4lt
         cTl2s+b/2+n+LqMlUrQ3pcpeqA7U34rXLFgYg8FWy6Rkn45Imm8YjlH/VF/218PogbpW
         +U0G/2OMIJsvG9UNr7Nu7TfdbhqMc47P1om6Wz6HJpsSpofyAP3Z81Q3V2aO2MCQMYCk
         F1mB9zkxD725C+Ivi5vT9v8aMeF5P7dstRIBQIjEPUa7O8ZSI/akI5Q5igRJWqQAjHIM
         /FqgSKkUtOIZK1fuTOx+PLJseN6Mzr5+j1nk0G9lahL7yjfb9RwdGbpnWHGSVgC6pTOm
         qLSw==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
X-Gm-Message-State: AKS2vOy/crDFEGvyVOCPpliQ2UmPc8BxeYjylTUUaVDbW7wPgUmWI1gq
	r7F2miip51EplW4ygdR4F++xrNGZ4iHvR/zHvT0PVg==
X-Received: by 10.202.231.143 with SMTP id e137mr24882759oih.189.1499171725446;
        Tue, 04 Jul 2017 05:35:25 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.64.84 with SMTP id n81csp918868oia;
        Tue, 4 Jul 2017 05:35:24 -0700 (PDT)
X-Received: by 10.28.45.133 with SMTP id t127mr19001515wmt.107.1499171723919;
        Tue, 04 Jul 2017 05:35:23 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499171723; cv=none;
        d=google.com; s=arc-20160816;
        b=sIRVBGGNT65AdpwJBXHMUWP7hMxtfjLYvotUzQa4L74Y+8wuMj2dXDgxAdQTstCRoO
         F32g6nnNh/nUP9Uj2K90PImSI/W3BznwbEimJ3V8CIE4C2PDk+HuewAEhrmYo9BrHpqr
         LcwSouhwxFVAFt8GMEPcT6ZqbrMMHItDu5LSlWDnNteQbj+2b0kdazWqHhj8BDjuJje/
         jJAO+nRETY2WoVgiJssSvmni3092xV4CER6rHNyFf2oNLyq8f5GHXe2zlZvHtEvLjSaK
         zwCJXpG4xgBXc0eCrTziGk1NYGc41OmgxJQNl9/sCFbnnJSyDF2+BETzGJCcGER2Rc8y
         a3yg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help
         :list-post:list-archive:list-unsubscribe:list-id:precedence:subject
         :user-agent:message-id:references:in-reply-to:to:from:date
         :mime-version:arc-authentication-results;
        bh=2HxFOJcS4wi9mKludcEA3sOVi761fAge3vnLNAtnsSg=;
        b=MA9DB9BOfh36oCNSJGKaPxA2aYC3XLzqHtR1Bekxssn5MH3UtZvi66Wz9yGhD7a1Tu
         bZXmKkD4z8rC8JLwYCtnkvlC69DpHOKiGBrxQt40ewaPKl2eiBN9Cbivw2VswjbYdcuc
         zZW0hV6cQDwzHjcIJ0OWPaIqlju9XrIJdLpAZGOq8LlLLx3A0+oVoViaAZIVEO590Qb5
         2/LEDcPeJ816wjwiQdEiaTTYPYhsNkjAEeTo3le6vt+fUys1klcE8cYKPXc70U5omBaZ
         1ufLNRBuM1/VDjYgo+CIggLS0unYXzAm6jNLv01Qs+FBL9Gux5NgjqyHe4w5QzOT7mvx
         4jTQ==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id h71si16768632wmi.1.2017.07.04.05.35.22;
        Tue, 04 Jul 2017 05:35:23 -0700 (PDT)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 8899A35C04B;
	Tue,  4 Jul 2017 07:33:59 -0500 (EST)
Received: from b-painless.mh.aa.net.uk (b-painless.mh.aa.net.uk [81.187.30.52])
	by lists.maptools.org (Postfix) with ESMTPS id C066E35C049
	for <tiff@lists.maptools.org>; Tue,  4 Jul 2017 07:20:30 -0500 (EST)
Received: from a-webmail.mh.aa.net.uk ([2001:8b0:0:30::75]
	helo=webmail.aa.net.uk) by b-painless.mh.aa.net.uk with esmtpsa
	(TLS1.0:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2)
	(envelope-from <rleigh@codelibre.net>) id 1dSMof-00087c-Lx
	for tiff@lists.maptools.org; Tue, 04 Jul 2017 13:20:30 +0100
Received: from [134.36.162.189] by webmail.aa.net.uk
	with HTTP (HTTP/1.1 POST); Tue, 04 Jul 2017 13:20:29 +0100
MIME-Version: 1.0
Date: Tue, 04 Jul 2017 13:20:29 +0100
From: rleigh@codelibre.net
To: tiff@lists.maptools.org
In-Reply-To: <15146403.Hy9LK3uOdm@even-i700>
References: <alpine.GSO.2.20.1705211423410.6623@freddy.simplesystems.org>
	<595B7643.5040000@osa.pri.ee> <15146403.Hy9LK3uOdm@even-i700>
Message-ID: <e56af1a6823fe8904a8c5121601553df@codelibre.net>
X-Sender: rleigh@codelibre.net
User-Agent: Roundcube Webmail/1.1.5
X-Painless-Spam-Score: -1.0
Subject: Re: [Tiff] A bug in libtiff error/warning handling
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On 2017-07-04 12:30, Even Rouault wrote:
> p, li { white-space: pre-wrap; }
> 
> On mardi 4 juillet 2017 14:04:35 CEST Paavo Helde wrote:
> 
>> I would like to report what I think is a bug in libtiff error and
> 
>> warning handling. There are two error handlers which can be
> installed
[...]
> That's a good point, but I wonder why you would have both error
> handlers installed ? That isn't really expected.

A larger application might use several libraries which might use 
libtiff.  One library migth use one handler, and another library might 
use the other.  Neither would be aware of the other's actions.

In the libraries I maintain, we use a thread-safe RAII wrapper around 
libtiff to set and unset the handlers on the fly.  It's horrible, but it 
does make this safer.  Though it still can't cope with another thread 
directly setting the handlers behind its back.

> I'm wondering if we shouldn't use the HandlerExt on priority over the
> Handler to avoid the warning/error to be reported twice ? What do
> other devs think ?

Why can't Handler delegate to HandlerExt so that there's only ever a 
single handler irrespective of which call you use?  Can't Handler 
register its own private handler with HandlerExt which strips off the 
thandle and calls the user-supplied handler?  Internally, only the Ext 
variant need be invoked, with Handler wrapping it transparently.


Regards,
Roger

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
