AE::Handle::DESTROY w/ encoding.

Marc Lehmann schmorp at schmorp.de
Sun Dec 23 07:21:12 CET 2012


On Fri, Dec 21, 2012 at 04:16:01PM -0800, gleeco <gleeco at gmail.com> wrote:
> in AnyEvent::Handle::DESTROY, the $wbuf isn't afforded the same luxuray of
> utf8::downgrade()

syswrite should downgrade automatically. if it does not, thats a bug in
perl. however, this is a red herring.

> as the other syswrite call found via push_write().  If you are so
> unlucky as to have a Wide char inside of wbuf in the DESTROY

There are lots of bugs that can result in this behaviour. The best way is
indeed to fix them.

However, the stroy has a problem: the behaviour of lingerign and normal
writes is the same, so this behaviour cannot be related to DESTROY.

Most likely this is simply caused by a push_write writing non-octet data,
and the next write will cause problems, regardless of DESTROY.

> bug?

Definitely.

> caller should be using correct coding, sure; but a surprise awaits if
> one gets these conditions to line up. a similar utf8::downgrade seemed
> to fix.

As I said, the DESTROY and lingering don't treat your data differently,
and there are many usage bugs that result in bad behaviour.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the anyevent mailing list