pcp
[Top] [All Lists]

Re: Python code vs local: host connections

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: Python code vs local: host connections
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Tue, 17 Sep 2013 15:59:26 -0400
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0m61tzr1vf.fsf@xxxxxxxx> (Frank Ch. Eigler's message of "Tue, 17 Sep 2013 09:53:08 -0400")
References: <100234653.22684536.1379397669579.JavaMail.root@xxxxxxxxxx> <503959600.22684715.1379397714223.JavaMail.root@xxxxxxxxxx> <y0m61tzr1vf.fsf@xxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
I wrote:

> While the new implementation of pmGetContextHostName does a strdup,
> it's not documented to do that.  [...]

Perhaps we could backtrack on that, and instead use a static char[...]
in that function; strcpy strings into that, return its pointer.
Thread-unsafe, yeah, but it would still be an improvement over the
status quo ante, because the race conditions there were worse:
pointers into dynamic pmcd context objects were being returned.  With
the static-char[] case, at worst multithreaded apps could suffer from
some string content corruption.

- FChE

<Prev in Thread] Current Thread [Next in Thread>