Bug 143759 - iiimf-emacs never talks to unix domain socket
iiimf-emacs never talks to unix domain socket
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: iiimf (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
: i18n
Depends On:
Blocks: IIIMF
  Show dependency treegraph
 
Reported: 2004-12-26 21:21 EST by Takanori MATSUURA
Modified: 2007-11-30 17:10 EST (History)
4 users (show)

See Also:
Fixed In Version: iiimf-12.2-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-23 02:45:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
iiimp helper program (2.29 KB, text/x-csrc)
2005-01-10 09:59 EST, Hiroshi Miura
no flags Details
Patch to support unix domain socket (6.21 KB, patch)
2005-01-15 01:09 EST, Hiroshi Miura
no flags Details | Diff
build udclient with CFLAGS (462 bytes, patch)
2005-03-31 05:52 EST, 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 06:02 EST, Takanori MATSUURA
no flags Details | Diff

  None (edit)
Description Takanori MATSUURA 2004-12-26 21:21:27 EST
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 15:32:09 EST
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 00:59:52 EST
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 09:59:49 EST
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 10:07:11 EST
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 01:09:08 EST
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 05:52:51 EST
Created attachment 112505 [details]
build udclient with CFLAGS
Comment 7 Takanori MATSUURA 2005-03-31 06:02:13 EST
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 06:08:42 EST
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 06:50:11 EST
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 02:23:45 EDT
(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 10:10:08 EDT
should be fixed in 12.1.1-11.svn2435. confirmed it working on emacs.
Comment 12 Lawrence Lim 2005-05-23 02:45:15 EDT
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.