projects
/
rrq
/
lsp-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modified test.
[rrq/lsp-utils.git]
/
lsp-dbus
/
lsp-dbus-events.lsp
diff --git
a/lsp-dbus/lsp-dbus-events.lsp
b/lsp-dbus/lsp-dbus-events.lsp
index 3bde66144bc3295361f58f956cfde93e3c943cec..634ab07ae2b33a12fef672e637456536d8a9c324 100644
(file)
--- a/
lsp-dbus/lsp-dbus-events.lsp
+++ b/
lsp-dbus/lsp-dbus-events.lsp
@@
-44,9
+44,7
@@
(write-line 2 (format "** No handler %s for:\n%s" KEY (string MSG))))
(define (process-message MSG)
(write-line 2 (format "** No handler %s for:\n%s" KEY (string MSG))))
(define (process-message MSG)
- ;;(die nil (list 'process-message MSG))
(let ((KEY (message-key MSG)))
(let ((KEY (message-key MSG)))
- ;;(die nil "Dbus:process-message" KEY (and (RECV KEY) true))
(if (RECV KEY) ($it (lookup "" MSG))
(no-handler KEY MSG))))
(if (RECV KEY) ($it (lookup "" MSG))
(no-handler KEY MSG))))
@@
-58,7
+56,6
@@
;; asyncronous events
(define (main-loop S)
(let ((FDS (list 0 (:%socket SYSTEM-BUS))) (FD nil))
;; asyncronous events
(define (main-loop S)
(let ((FDS (list 0 (:%socket SYSTEM-BUS))) (FD nil))
- ;;(die nil "Dbus:main-loop" (length pending) "pending")
(write 2 (string "> "))
(while (or pending (not (member 0 (net-select FDS "r" -1))))
(if (pop pending) (process-message $it)
(write 2 (string "> "))
(while (or pending (not (member 0 (net-select FDS "r" -1))))
(if (pop pending) (process-message $it)
@@
-67,9
+64,12
@@
))
"main-loop: "))
))
"main-loop: "))
+(define (human-msg MSG)
+ (human-bytes (unpack (dup "b" (length MSG)) MSG)))
+
;; Send message, then keep reading messages until there is a reply
(define (send-recv-message MSG)
;; Send message, then keep reading messages until there is a reply
(define (send-recv-message MSG)
- ;;(die nil (list 'send-recv-message (
octals-strin
g MSG)))
+ ;;(die nil (list 'send-recv-message (
human-ms
g MSG)))
(net-send (:%socket SYSTEM-BUS) MSG)
(let ((REPLY nil))
(while (nil? REPLY)
(net-send (:%socket SYSTEM-BUS) MSG)
(let ((REPLY nil))
(while (nil? REPLY)