Bug 143759 - iiimf-emacs never talks to unix domain socket
Summary: iiimf-emacs never talks to unix domain socket
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: iiimf
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jens Petersen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: IIIMF
TreeView+ depends on / blocked
 
Reported: 2004-12-27 02:21 UTC by Takanori MATSUURA
Modified: 2007-11-30 22:10 UTC (History)
4 users (show)

Fixed In Version: iiimf-12.2-3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-05-23 06:45:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
iiimp helper program (2.29 KB, text/x-csrc)
2005-01-10 14:59 UTC, Hiroshi Miura
no flags Details
Patch to support unix domain socket (6.21 KB, patch)
2005-01-15 06:09 UTC, Hiroshi Miura
no flags Details | Diff
build udclient with CFLAGS (462 bytes, patch)
2005-03-31 10:52 UTC, Takanori MATSUURA
no flags Details | Diff
diff of iiimf.spec from iiimf-12.1.1-10.svn2390 and mine (1.92 KB, patch)
2005-03-31 11:02 UTC, Takanori MATSUURA
no flags Details | Diff

Description Takanori MATSUURA 2004-12-27 02:21:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6) Gecko/20041226 Firefox/1.0+

Description of problem:
When iiimf-emacs is installed and type 'Ctrl-\' on emacs, emacs searches localhost:9010 to talk to IIIM server.  But emacs cannot talk to localhost:9010 because im-sdk recently released is closed localhost:9010 and unix domain socket is used.

To solve this bug, iiimecf should be fixed to talk unix domain socket.
This bug is critical for all users using IIIMF on emacs.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.install iiimf-emacs
2.run emacs
3.type 'C-\'
  

Actual Results:  cannot use IIIMF on emacs

Expected Results:  can use IIIMF on emacs

Additional info:

When emacs runs with "(setq debug-on-error t)" and type 'C-\', the following backtrace is generated.

Debugger entered--Lisp error: (file-error "connection failed" "Connection refused" "localhost" "IIIMP")
open-network-stream("IIIMP" #<buffer *IIIMP*> "localhost" 9010)
iiimp-open-network-channel("localhost" 9010 #<buffer *IIIMP*>)
iiimp-create-network-channel("localhost" 9010)
iiimcf-connect-com("localhost" 9010)
apply(iiimcf-connect-com ("localhost" 9010))
iiimcf-server-control-setup-com-id()
iiimcf-server-control-setup()
iiimcf-server-control-activate("iiim")
apply(iiimcf-server-control-activate "iiim" nil)
activate-input-method("iiim")
toggle-input-method((4))
call-interactively(toggle-input-method)

Comment 1 Jens Petersen 2004-12-31 20:32:09 UTC
AFAIK iiimp-open-network-channel doesn't currently support connections
to unix domain sockets: so fixing this may have to wait for the next release
of Emacs.

Comment 2 Hiroshi Miura 2005-01-10 05:59:52 UTC
You can hack iiimp-open-network-channel to use simple helper program which
connect to unix domain socket and relay it to stdin/out.
What you need is not just to wait for next relase of Emacs, but send request to
upstream author of iiimecf, I think.

A modification of iiimp.el is like as follows(not tested yet):

--- iiimp.el~   2002-07-15 20:18:13.000000000 +0900
+++ iiimp.el    2005-01-10 12:53:03.000000000 +0900
@@ -68,6 +68,8 @@

 (defvar iiimp-text-warning-char ?!)

+(defvar iiimp-helper-path "iiimp")
+
 (defconst iiimp-basic-opcode-spec-list
   '((iiimp-im-no-protocol
      0 (nil . nil)
@@ -391,7 +393,10 @@
          (set-buffer-multibyte nil))
       (buffer-disable-undo buf)
       (setq proc
-           (open-network-stream iiimp-process-name buf host port))
+           (cond ((string= host "unix")
+                  (let ((process-connection-type nil))
+                    (start-process "iiimp" nil iiimp-helper-path)))
+                 (t (open-network-stream iiimp-process-name buf host port))))
       (process-kill-without-query proc)
       (set-process-coding-system proc 'binary 'binary)
       (set-process-sentinel



Comment 3 Hiroshi Miura 2005-01-10 14:59:49 UTC
Created attachment 109559 [details]
iiimp helper program

This is a trial version of helper program to support unix domain socket.
This is based on yc-el's icanna.c program.

Comment 4 Hiroshi Miura 2005-01-10 15:07:11 UTC
For original bug report, we may enable tcp connection on iiimf when installing
iiimecf. To do so, uncomment below lines on /etc/iiim/htt.xml.conf
         <listen type="tcp">
            <hostname>localhost</hostname>
            <port>9010</port>
        </listen>
For security reason, it may not be recommended.

Comment 5 Hiroshi Miura 2005-01-15 06:09:08 UTC
Created attachment 109812 [details]
Patch to support unix domain socket

This is a patch to support unix domain socket. It works fine.
I modified iiimp.el and create new helper program 'udclient'.

udclient is a general purpose program to communicate with unix domain socket
data stream. It should install the path described in PATH.

user can use it with set (setq iiimcf-server-control-hostlist '("unix"))
Now it coflict with the server named "unix" so I need more work.

I test it with IIIMF trunk 2059 and ATOK X2 (Ver 17.0:most newest)

I want it to send upstreams directly.

Comment 6 Takanori MATSUURA 2005-03-31 10:52:51 UTC
Created attachment 112505 [details]
build udclient with CFLAGS

Comment 7 Takanori MATSUURA 2005-03-31 11:02:13 UTC
Created attachment 112506 [details]
diff of iiimf.spec from iiimf-12.1.1-10.svn2390 and mine

attachment 112505 [details] and this modification of spec file solves this bug without
waiting next release of Emacs.
A command to communicate with server through unix domain socket that Miura put
here is now inclueded in upstream source.
Thank you for nice job, Miura and iiimf developpers.

Jens, please review this one.

Comment 8 Takanori MATSUURA 2005-03-31 11:08:42 UTC
For testers:
Please set your ~/.emacs as following

;; use iiimf
(setq default-input-method 'iiim)
(setq iiimcf-server-control-hostlist '("unix/:9010"))

I think iiimcf-server-control-hostlist valiable should be added to
/usr/share/emacs/site-lisp/site-start.d/iiimecf-init.el

Comment 9 Akira TAGOH 2005-03-31 11:50:11 UTC
The fix to contains udclient in the package was already in Fedora CVS
repository. it will be available next release. thank you for notifying us anyway.

Comment 10 Jens Petersen 2005-04-04 06:23:45 UTC
(In reply to comment #6)

Thanks - I committed this upstream in svn2428.

(In reply to comment #9)
> The fix to contains udclient in the package was already in Fedora CVS
> repository.

Right - though I had problems getting it working under rawhide so far...



Comment 11 Akira TAGOH 2005-04-04 14:10:08 UTC
should be fixed in 12.1.1-11.svn2435. confirmed it working on emacs.

Comment 12 Lawrence Lim 2005-05-23 06:45:15 UTC
Confirmed fixed. Tested with iiimf-12.2-3. Was able to load IIIMF and use Canna
LE via default unix socket.




Note You need to log in before you can comment on or make changes to this bug.