Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx10.public.one.com ([10.246.18.30])
	by mail6.local.one.com (Dovecot) with LMTP id rFslNpr6y1h5EQEAsyOMew
	for <filtered@awaresystems.be>; Fri, 17 Mar 2017 15:54:13 +0000
X-HalOne-ID: f701eaa9-0b29-11e7-9c98-246e9615723c
Received: from mail-ot0-f172.google.com (unknown [74.125.82.172])
	by mx10.public.one.com (Halon) with ESMTPS
	id f701eaa9-0b29-11e7-9c98-246e9615723c;
	Fri, 17 Mar 2017 15:54:13 +0000 (UTC)
Received: by mail-ot0-f172.google.com with SMTP id i1so95879939ota.3
        for <filtered@awaresystems.be>; Fri, 17 Mar 2017 08:54:13 -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:in-reply-to:references:from:date:message-id:to:cc
         :subject:precedence:list-id:list-unsubscribe:list-archive:list-post
         :list-help:list-subscribe:mime-version:sender:errors-to;
        bh=mkKQFvd3Ww1aMWwsKEkjnyT4x9VK6PpW6+OqsA72Lok=;
        b=LfI3tFgYH0WlBEDWLhzkl6fWD+q7jC19ZL/y30E3W414KltiQz3PZJx4aZA+11OpxS
         qD0FMIQnnV6zZxLoKQ5pDnz0fuU5M45X7Gf3wax8vlqpLZSR17E4mT+zeOtAoIUeR/dL
         HnMyed2qYXzfN4LSy1aPmULYoRLRtiiA8XgtCz/ipY+62WbFenzsUuGNm7Kly2tnamzu
         sAxCCqEeaVmfpwsSAuaApip4P3t4s6/62QjqOrWu5AHRDOYDdbaWdmW9pYh3dJ3Ib/nf
         liCx0aOTQqTD1Eg+hGDz4q01PjHiWV72mhTlOabfWBo6iI/TDUD9SVI/b6nnajFzwbkd
         QJCQ==
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;       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
X-Gm-Message-State: AFeK/H2gfbT5bOKUw5nWu1UqU24UYqW586+ByrDI9hZJneHvRhcggyWkybjDWfL6AOs93RpUn5MLGACXhzEatiNC+1nZrtM=
X-Received: by 10.157.10.168 with SMTP id 37mr8450209otq.215.1489766051997;
        Fri, 17 Mar 2017 08:54:11 -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.195.2 with SMTP id t2csp347607oif;
        Fri, 17 Mar 2017 08:54:11 -0700 (PDT)
X-Received: by 10.28.94.194 with SMTP id s185mr3428026wmb.52.1489766051085;
        Fri, 17 Mar 2017 08:54:11 -0700 (PDT)
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 l44si359506wrl.51.2017.03.17.08.54.10;
        Fri, 17 Mar 2017 08:54:11 -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;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 492EF35C047;
	Fri, 17 Mar 2017 10:53:14 -0500 (EST)
Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com
	[209.85.216.172])
	by lists.maptools.org (Postfix) with ESMTPS id 2416735C044
	for <tiff@lists.maptools.org>; Fri, 17 Mar 2017 10:53:03 -0500 (EST)
Received: by mail-qt0-f172.google.com with SMTP id r45so65912363qte.3
	for <tiff@lists.maptools.org>; Fri, 17 Mar 2017 08:53:03 -0700 (PDT)
X-Received: by 10.237.37.71 with SMTP id w7mr13902174qtc.34.1489765981892;
	Fri, 17 Mar 2017 08:53:01 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.12.186.44 with HTTP; Fri, 17 Mar 2017 08:53:01 -0700 (PDT)
In-Reply-To: <alpine.GSO.2.20.1703170947500.4525@scrappy.simplesystems.org>
References: <CAHcSuBpB46=uPKCS48LuFCqbZ1GeQau6_f8Bbbj5fs6LbJdE+Q@mail.gmail.com>
	<alpine.GSO.2.20.1703170947500.4525@scrappy.simplesystems.org>
From: Dinesh Iyer <dsi.maillist@gmail.com>
Date: Fri, 17 Mar 2017 11:53:01 -0400
Message-ID: <CAHcSuBqZQh4kJH_R_9LEkpnjRm=s-CmOE_vcoyRF6fxgwt1B8A@mail.gmail.com>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Cc: TIFF mailing list <tiff@lists.maptools.org>
Subject: Re: [Tiff] TIFFSetErrorHandler vs TIFFSetErrorHandlerExt
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: multipart/mixed; boundary="===============1373065958=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============1373065958==
Content-Type: multipart/alternative; boundary=001a114203d6265257054aef2c0b

--001a114203d6265257054aef2c0b
Content-Type: text/plain; charset=UTF-8

Thanks Bob.

If I understand you correctly, I cannot have multiple threads each with its
own handler throwing errors/warnings. i need to ensure that only one thread
does the error handling, am I correct?

As a follow up, do i have to set the client_data field with a pointer to my
class such that it is accessible in the callbacks?

Regards
Dinesh

On Fri, Mar 17, 2017 at 10:53 AM, Bob Friesenhahn <
bfriesen@simple.dallas.tx.us> wrote:

> On Fri, 17 Mar 2017, Dinesh Iyer wrote:
>
> Hi team,
>> I need to do some custom error handling which requires me to pass in the
>> pointer to my class that is doing the TIFF I/O. I need this because I need
>> to deliver warnings/errors to my application through a specific mechanism.
>>
>> I noticed that TIFFSetErrorHandlerExt does allow me to pass that as the
>> first argument. I was wondering if it is sufficient to set one of the
>> error
>> handlers or do I have to set both. The same applies for warning handlers
>> as
>> well.
>>
>
> These functions are redudant and both may be used at once.  If
> TIFFSetErrorHandler() was used, then its error handler will be called. If
> TIFFSetErrorHandlerExt() was used, then its error handler will be called.
> They are called in succession.
>
> This means that you can just use TIFFSetErrorHandlerExt() and be happy.
>
> The main problem with these interfaces is that the internal storage
> location is shared across threads so threads can't use different handlers
> unless they serialize access to libtiff.
>
> Bob
> --
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>

--001a114203d6265257054aef2c0b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks Bob.<div><br></div><div>If I understand you correct=
ly, I cannot have multiple threads each with its own handler throwing error=
s/warnings. i need to ensure that only one thread does the error handling, =
am I correct?<br><div><br></div><div>As a follow up, do i have to set the c=
lient_data field with a pointer to my class such that it is accessible in t=
he callbacks?</div><div><br></div><div>Regards</div><div>Dinesh</div></div>=
</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, Mar=
 17, 2017 at 10:53 AM, Bob Friesenhahn <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:bfriesen@simple.dallas.tx.us" target=3D"_blank">bfriesen@simple.dallas.=
tx.us</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=
=3D"">On Fri, 17 Mar 2017, Dinesh Iyer wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Hi team,<br>
I need to do some custom error handling which requires me to pass in the<br=
>
pointer to my class that is doing the TIFF I/O. I need this because I need<=
br>
to deliver warnings/errors to my application through a specific mechanism.<=
br>
<br>
I noticed that TIFFSetErrorHandlerExt does allow me to pass that as the<br>
first argument. I was wondering if it is sufficient to set one of the error=
<br>
handlers or do I have to set both. The same applies for warning handlers as=
<br>
well.<br>
</blockquote>
<br></span>
These functions are redudant and both may be used at once.=C2=A0 If TIFFSet=
ErrorHandler() was used, then its error handler will be called. If TIFFSetE=
rrorHandlerExt() was used, then its error handler will be called.=C2=A0 The=
y are called in succession.<br>
<br>
This means that you can just use TIFFSetErrorHandlerExt() and be happy.<br>
<br>
The main problem with these interfaces is that the internal storage locatio=
n is shared across threads so threads can&#39;t use different handlers unle=
ss they serialize access to libtiff.<span class=3D"HOEnZb"><font color=3D"#=
888888"><br>
<br>
Bob<br>
-- <br>
Bob Friesenhahn<br>
<a href=3D"mailto:bfriesen@simple.dallas.tx.us" target=3D"_blank">bfriesen@=
simple.dallas.tx.us</a>, <a href=3D"http://www.simplesystems.org/users/bfri=
esen/" rel=3D"noreferrer" target=3D"_blank">http://www.simplesystems.org/u<=
wbr>sers/bfriesen/</a><br>
GraphicsMagick Maintainer,=C2=A0 =C2=A0 <a href=3D"http://www.GraphicsMagic=
k.org/" rel=3D"noreferrer" target=3D"_blank">http://www.GraphicsMagick.org/=
</a><br>
</font></span></blockquote></div><br></div>

--001a114203d6265257054aef2c0b--

--===============1373065958==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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