ejabberd - Comments for "Can&amp;#039;t get extauth to work" https://www.ejabberd.im/node/706 en The string seems to include https://www.ejabberd.im/node/706#comment-1893 <p>The string seems to include the 'domain' now..</p> <p>method:username:domain:password</p> Wed, 21 Jun 2006 05:46:34 +0000 cowmix comment 1893 at https://www.ejabberd.im First of all, you have to https://www.ejabberd.im/node/706#comment-1468 <p>First of all, you have to read bytes in big-endian order, also struct.unpack returns a tuple and you have to obtain first element from it.<br /> So, the string:</p> <pre>length = struct.unpack('h', nread)</pre><p> Should looks like this:</p> <pre>length = struct.unpack('!h', nread)[0]</pre><p> The second: splitting</p> <pre>op, user, password = nread.split(':', 3)</pre><p>is incorrect, because the "auth" and "setpass" operations have user,domain,password as its arguments and the "isuser" operation has user,domain as it arguments.</p> <p>And the third: you have to flush() sys.stdout after all write() methods.</p> Fri, 17 Mar 2006 07:39:56 +0000 xram@jabber.ru comment 1468 at https://www.ejabberd.im