That seems like a bad patch.  You&#39;re modifying the caller&#39;s buffer!  You really just want to modify the buffer that you write out to the socket.<div><br></div><div><div><div><div class="gmail_quote">On Mon, May 11, 2009 at 11:15 PM, Vladimir Lettiev <span dir="ltr">&lt;<a href="mailto:thecrux@gmail.com">thecrux@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yeah, this patch fixed the problem! Thank you, Eugene.<br>
<br>
(CC: DJabberd List)<br>
<br>
2009/5/11 Eugene Mamaev [emamaev at gmail dot com]:<br>
&gt; Hello Vladimir,<br>
&gt;<br>
&gt; Thursday, May 7, 2009, 11:12:23 AM, you wrote:<br>
&gt;<br>
&gt;&gt; 2009/5/7 Eugene Mamaev [emamaev at gmail dot com]:<br>
&gt;&gt;&gt; I was trying to subscribe to their list several times but it seems<br>
&gt;&gt;&gt; does not work. I did not get list digest on my email. I found your<br>
&gt;&gt;&gt; note in djd list from google. I have a guess that the problem persists<br>
&gt;&gt;&gt; if roster contains non ASCII chars. How to write to their list?<br>
&gt;<br>
&gt;&gt; Did you try to send mail to <a href="mailto:djabberd@lists.danga.com">djabberd@lists.danga.com</a> ?<br>
&gt;<br>
&gt;&gt; There was some problem, but it fixed now:<br>
&gt;&gt; <a href="http://lists.danga.com/pipermail/djabberd/2009-March/000709.html" target="_blank">http://lists.danga.com/pipermail/djabberd/2009-March/000709.html</a><br>
&gt;<br>
&gt; Message is awaiting of moderator approval from may 7. Below is my fix,<br>
&gt; please check if this helps to you.<br>
&gt;<br>
&gt; Index: StartTLS.pm<br>
&gt; ===================================================================<br>
&gt; --- StartTLS.pm<br>
&gt; +++ StartTLS.pm<br>
&gt; @@ -2,6 +2,7 @@<br>
&gt;  use strict;<br>
&gt;  use base qw(DJabberd::Stanza);<br>
&gt;  use Net::SSLeay;<br>
&gt; +use Encode qw(is_utf8 encode_utf8);<br>
&gt;<br>
&gt;  Net::SSLeay::load_error_strings();<br>
&gt;  Net::SSLeay::SSLeay_add_ssl_algorithms();<br>
&gt; @@ -84,6 +85,10 @@<br>
&gt;         # NO LONGER RELEVANT?<br>
&gt;         # $to_write = 4096 if $to_write &gt; 4096;<br>
&gt;<br>
&gt; +        if (is_utf8($$bref) &amp;&amp; length($$bref) != $to_write) {<br>
&gt; +            $$bref = encode_utf8($$bref);<br>
&gt; +        }<br>
&gt; +<br>
&gt;         my $str = substr($$bref, $offset, $to_write);<br>
&gt;         my $written = Net::SSLeay::write($ssl, $str);<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Best regards,<br>
&gt;  Eugene                            mailto:<a href="mailto:emamaev">emamaev</a> at gmail dot com<br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
--<br>
Vladimir Lettiev aka crux &lt;<a href="mailto:theCrux@gmail.com">theCrux@gmail.com</a>&gt;<br>
</font></blockquote></div><br></div></div></div>