Re: distel and emacs unicode-2 (again)

Matthew D Swank <[email protected]> Mon, 04 Jun 2007 01:01:56 -0500
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
On Sun, 03 Jun 2007 18:08:13 +0200, Luke Gorrie wrote:

> Matthew D Swank <[email protected]> writes:
> 
>> I am still at a loss as to what is wrong when I try to use distel in emacs
>> 23.x.  Could someone *please* give me some feed-back on what might be
>> wrong.
>>
>> Here is a typical trace from running a command that needs to connect to a
>> node (in this case erl-process-list):
>>
>> Debugger entered--Lisp error: (error "lucretia/-29892 Servname not supported for ai_socktype")
>>   make-network-process(:name "netfsm" :buffer #<buffer  *net-fsm*> :host "lucretia" :service -29892)
>>   open-network-stream("netfsm" #<buffer  *net-fsm*> "lucretia" -29892)
> 
> Emacs is trying to open a socket to host lucretia on port -29892.
> The port number is invalid, hence the error.
> 
> The bug is probably in epmd-recv-port-resp where decoding the port
> number from epmd out of an emacs buffer and into an integer is going
> awry. This is a common sort of problem when keeping binary data in
> Emacs buffers: you get a lot of unwanted problems with conversions
> when Emacs wants to intepret the contents of buffers as encoded
> characters instead of plain bytes.
> 

Thanks you.

After looking at epmd-recv-port-resp, I came up with this patch:

Index: elisp/epmd.el
===================================================================
--- elisp/epmd.el       (revision 15)
+++ elisp/epmd.el       (working copy)
@@ -28,7 +28,7 @@
   (ecase event
     ((data)
      (assert (= (length arg) 2))
-     (fsm-terminate (+ (ash    (elt arg 0) 8)
+     (fsm-terminate (+ (ash (logand (elt arg 0) 255) 8) 
                       (logand (elt arg 1) 255))))
     ((closed)
      (fsm-fail))))

However, I'm still getting a node down message.  In fsm-connect
the call to fsm-open-socket seems to be completing ok.  The call to
fsm-attach looks like the next culprit.  I'm kind of flying blind on the
protocol, so I'm not sure what to look for next.

Matt


-- 
"You do not really understand something unless you can
 explain it to your grandmother." — Albert Einstein.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Distel-hackers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/distel-hackers