Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Integrated new debugging framework

* rudel-debug.el (header): updated copyright; fixed keywords; extended
  commentary section; added 0.2 to history section
  (require rudel-transport-util):
  (require rudel-socket): now required, since we install methods
  (rudel-debug-tag-faces): changed from constant to variable
  (rudel-state-change :before):
  (rudel-debug-stream-name):
  (rudel-debug-stream-insert): removed; replaced by
  `rudel-debug-write-to-stream' and `rudel-debug-write'
  (rudel-debug-target): new generic function; determine debug stream
  for an object
  (rudel-debug-write-to-stream): new function; write information to
  debug stream
  (rudel-debug-write): new function; write information to debug stream
  for a specific object
  (rudel-debug-old-state):
  (rudel-state-machine::rudel-switch :before):
  (rudel-state-machine::rudel-switch :after): new variable/methods;
  state machine debugging
  (rudel-assembling-transport-filter::rudel-set-assembly-function	:before):
  (rudel-assembling-transport-filter::rudel-set-filter):
  (rudel-assembling-transport-filter::rudel-send :before): new
  methods; debugging for `rudel-assembling-transport-filter'
  (rudel-parsing-transport-filter::rudel-set-parse-function :before):
  (rudel-parsing-transport-filter::rudel-set-generate-function :before):
  (rudel-parsing-transport-filter::rudel-set-filter):
  (rudel-parsing-transport-filter::rudel-send :before): new methods;
  debugging for `rudel-parsing-transport-filter'
  (rudel-socket-transport::rudel-set-filter):
  (rudel-socket-transport::rudel-send :before): new methods; debugging
  for `rudel-socket-transport'
* xmpp/rudel-xmpp-debug.el (header): fixed keywords; added 0.2 to
  history section
  (require rudel-xmpp-state): now required, since we install methods
  (rudel-xmpp-debug-old-state):
  (rudel-xmpp-transport::rudel-send :before):
  (rudel-xmpp-transport::rudel-accept :before): 
  (rudel-xmpp-transport::rudel-switch :before):
  (rudel-xmpp-transport::rudel-switch :after): removed; handled by
  generic stuff in rudel-debug.el now
  (rudel-xmpp-state::rudel-debug-target): new method; debug target for
  XMPP states
  (rudel-xmpp-state-sasl-mechanism-step::rudel-send):
  (rudel-xmpp-state-sasl-mechanism-step::rudel-send :after):
  (rudel-xmpp-state-sasl-mechanism-step::rudel-accept :before):
  rewritten for new debugging framework
* obby/rudel-obby-debug.el (header): updated copyright; added 0.2 to
  history section
  (require eieio):
  (require rudel-obby-util): removed; no longer needed
  (require rudel-obby-server): now required, since we install methods
  on server classes
  (rudel-obby-debug-old-state):
  (rudel-obby-connection::rudel-send :before):
  (rudel-obby-connection::rudel-accept :before):
  (rudel-obby-connection::rudel-switch :before):
  (rudel-obby-connection::rudel-switch :after): removed; handled by
  generic stuff in rudel-debug.el now
  (rudel-obby-connection::rudel-debug-target): new method; debug
  target for `rudel-obby-connection'
  (rudel-obby-client::rudel-debug-target): new method; debug target
  for `rudel-obby-client'
* TODO (Milestone 0.3): integrate new debugging framework is DONE
  • Loading branch information...
commit 6d9c9ca981a2f4dfca214731d35f2edea7ff61d1 1 parent a9da766
@scymtym authored
View
65 ChangeLog
@@ -1,5 +1,70 @@
2010-01-27 Jan Moringen <scymtym@users.sourceforge.net>
+ Integrated new debugging framework
+ * rudel-debug.el (header): updated copyright; fixed keywords;
+ extended commentary section; added 0.2 to history section
+ (require rudel-transport-util):
+ (require rudel-socket): now required, since we install methods
+ (rudel-debug-tag-faces): changed from constant to variable
+ (rudel-state-change :before):
+ (rudel-debug-stream-name):
+ (rudel-debug-stream-insert): removed; replaced by
+ `rudel-debug-write-to-stream' and `rudel-debug-write'
+ (rudel-debug-target): new generic function; determine debug stream
+ for an object
+ (rudel-debug-write-to-stream): new function; write information to
+ debug stream
+ (rudel-debug-write): new function; write information to debug
+ stream for a specific object
+ (rudel-debug-old-state):
+ (rudel-state-machine::rudel-switch :before):
+ (rudel-state-machine::rudel-switch :after): new variable/methods;
+ state machine debugging
+ (rudel-assembling-transport-filter::rudel-set-assembly-function :before):
+ (rudel-assembling-transport-filter::rudel-set-filter):
+ (rudel-assembling-transport-filter::rudel-send :before): new
+ methods; debugging for `rudel-assembling-transport-filter'
+ (rudel-parsing-transport-filter::rudel-set-parse-function :before):
+ (rudel-parsing-transport-filter::rudel-set-generate-function :before):
+ (rudel-parsing-transport-filter::rudel-set-filter):
+ (rudel-parsing-transport-filter::rudel-send :before): new methods;
+ debugging for `rudel-parsing-transport-filter'
+ (rudel-socket-transport::rudel-set-filter):
+ (rudel-socket-transport::rudel-send :before): new methods;
+ debugging for `rudel-socket-transport'
+ * xmpp/rudel-xmpp-debug.el (header): fixed keywords; added 0.2 to
+ history section
+ (require rudel-xmpp-state): now required, since we install methods
+ (rudel-xmpp-debug-old-state):
+ (rudel-xmpp-transport::rudel-send :before):
+ (rudel-xmpp-transport::rudel-accept :before):
+ (rudel-xmpp-transport::rudel-switch :before):
+ (rudel-xmpp-transport::rudel-switch :after): removed; handled by
+ generic stuff in rudel-debug.el now
+ (rudel-xmpp-state::rudel-debug-target): new method; debug target
+ for XMPP states
+ (rudel-xmpp-state-sasl-mechanism-step::rudel-send):
+ (rudel-xmpp-state-sasl-mechanism-step::rudel-send :after):
+ (rudel-xmpp-state-sasl-mechanism-step::rudel-accept :before):
+ rewritten for new debugging framework
+ * obby/rudel-obby-debug.el (header): updated copyright; added 0.2
+ to history section
+ (require eieio):
+ (require rudel-obby-util): removed; no longer needed
+ (require rudel-obby-server): now required, since we install
+ methods on server classes
+ (rudel-obby-debug-old-state):
+ (rudel-obby-connection::rudel-send :before):
+ (rudel-obby-connection::rudel-accept :before):
+ (rudel-obby-connection::rudel-switch :before):
+ (rudel-obby-connection::rudel-switch :after): removed; handled by
+ generic stuff in rudel-debug.el now
+ (rudel-obby-connection::rudel-debug-target): new method; debug
+ target for `rudel-obby-connection'
+ (rudel-obby-client::rudel-debug-target): new method; debug target
+ for `rudel-obby-client'
+ * TODO (Milestone 0.3): integrate new debugging framework is DONE
+
Updated TODO
* TODO (Future):
(Milestone 0.4): minor adjustments
View
12 TODO
@@ -160,12 +160,6 @@
* Milestone rudel-0.3
-** TODO Integrate new debugging framework
- + Component :: multiple components affected
- + Type :: task
- + Priority :: major
- + Reporter :: jan
- + Assigned :: jan
** TODO Infinote client functionality
+ Component :: infinote-backend
+ Type :: task
@@ -225,6 +219,12 @@
+ Type :: defect
+ Reporter :: jan
+ Assigned ::
+** DONE Integrate new debugging framework
+ + Component :: multiple components affected
+ + Type :: task
+ + Priority :: major
+ + Reporter :: jan
+ + Assigned :: jan
** DONE Add XMPP transport backend
+ Component :: xmpp-backend
+ Type :: task
View
71 obby/rudel-obby-debug.el
@@ -1,6 +1,6 @@
;;; rudel-obby-debug.el --- Debugging functions for obby backend
;;
-;; Copyright (C) 2009 Jan Moringen
+;; Copyright (C) 2009, 2010 Jan Moringen
;;
;; Author: Jan Moringen <scymtym@users.sourceforge.net>
;; Keywords: rudel, obby, debugging
@@ -27,81 +27,36 @@
;;; History:
;;
+;; 0.2 - New debug infrastructure
+;;
;; 0.1 - Initial version
;;; Code:
;;
-(require 'eieio)
-
(require 'rudel-debug)
-(require 'rudel-obby-util)
(require 'rudel-obby-client)
+(require 'rudel-obby-server)
-;;; Variables
+;;; Client connection debugging
;;
-(defvar rudel-obby-debug-old-state nil
- "Saves state of state machines across one function call.")
+(defmethod rudel-debug-target ((this rudel-obby-connection))
+ "Return debug target of the transport as debug target for THIS."
+ (with-slots (transport) this
+ (rudel-debug-target transport)))
-;;; Functions
+;;; Server connection debugging
;;
-(defmethod rudel-send :before ((this rudel-obby-connection)
- name &rest arguments)
- "Print NAME and ARGUMENTS to debug stream."
- (let ((message (apply #'rudel-obby-assemble-message
- name arguments)))
-
- (with-slots (transport) this
- (rudel-debug-stream-insert
- (rudel-debug-stream-name transport)
- :sent
- (concat (substring message 0 (min (length message) 100))
- (when (> (length message) 100)
- "..."))
- (append (list name) arguments))))
- )
-
-(defmethod rudel-accept :before ((this rudel-obby-connection) data)
- "Print DATA to debug stream."
+(defmethod rudel-debug-target ((this rudel-obby-client))
+ "Return debug target of the transport as debug target for THIS."
(with-slots (transport) this
- (rudel-debug-stream-insert
- (rudel-debug-stream-name transport)
- :received
- (concat (substring data 0 (min (length data) 100))
- (when (> (length data) 100)
- "..."))))
- )
-
-(defmethod rudel-switch :before ((this rudel-obby-connection)
- state &rest arguments)
- "Store name of STATE for later printing."
- (with-slots (state) this
- (setq rudel-obby-debug-old-state
- (if state
- (object-name-string state)
- "#start")))
- )
-
-(defmethod rudel-switch :after ((this rudel-obby-connection)
- state &rest arguments)
- "Print STATE and ARGUMENTS to debug stream."
- (with-slots (transport state) this
- (let ((old-state rudel-obby-debug-old-state)
- (new-state (object-name-string state)))
- (unless (string= old-state new-state)
- (rudel-debug-stream-insert
- (rudel-debug-stream-name transport)
- :special
- (if arguments
- (format "%s -> %s %s" old-state new-state arguments)
- (format "%s -> %s" old-state new-state))))))
- )
+ (rudel-debug-target transport)))
(provide 'rudel-obby-debug)
;; Local Variables:
View
252 rudel-debug.el
@@ -1,9 +1,9 @@
;;; rudel-debug.el --- Debugging functions for Rudel
;;
-;; Copyright (C) 2009 Jan Moringen
+;; Copyright (C) 2009, 2010 Jan Moringen
;;
;; Author: Jan Moringen <scymtym@users.sourceforge.net>
-;; Keywords: Rudel, debugging
+;; Keywords: rudel, debugging
;; X-RCS: $Id:$
;;
;; This file is part of Rudel.
@@ -24,12 +24,16 @@
;;; Commentary:
;;
-;; Debugging functions for Rudel.
+;; This file contains debugging functions for Rudel. The most
+;; important aspects are functions to data-debug central Rudel objects
+;; and tracing support for basic Rudel objects.
;;; History:
;;
-;; 0.1 - Initial revision.
+;; 0.2 - New tracing framework
+;;
+;; 0.1 - Initial version
;;; Code:
@@ -41,6 +45,8 @@
(require 'rudel-util)
(require 'rudel-state-machine)
+(require 'rudel-transport-util)
+(require 'rudel-socket)
;;; Customization
@@ -70,15 +76,11 @@
"Face used for additional information."
:group 'rudel-debug)
-
-;;; Constants
-;;
-
-(defconst rudel-debug-tag-faces
- '((:sent . (rudel-debug-sent-data-face "< "))
- (:received . (rudel-debug-received-data-face "> "))
- (:state . (rudel-debug-state-face "| "))
- (:special . (rudel-debug-special-face "; ")))
+(defvar rudel-debug-tag-faces
+ '((:sent . (rudel-debug-sent-data-face "< "))
+ (:received . (rudel-debug-received-data-face "> "))
+ (:state . (rudel-debug-state-face "| "))
+ (:special . (rudel-debug-special-face "; ")))
"Associate tag to faces and prefixes.")
@@ -165,32 +167,19 @@
(setq rudel-current-session nil))
-;;; Socket debugging
-;;
-
-(defmethod rudel-state-change :before ((this rudel-state-machine)
- state message)
- "Print STATE and MESSAGE to debug stream."
- (with-slots (socket) this
- (rudel-debug-stream-insert
- (rudel-debug-stream-name socket)
- :state
- (format "connection state changed to %s: \"%s\""
- (upcase (symbol-name state))
- ;; MESSAGE ends with a newline; remove it
- (substring message 0 -1))))
- )
-
-
;;; Utility functions
;;
-(defun rudel-debug-stream-name (transport)
- "Return debug stream name for TRANSPORT."
- (object-name-string transport))
+(defgeneric rudel-debug-target (object)
+ "Return debug stream name for OBJECT.")
+
+(defmethod rudel-debug-target ((this eieio-default-superclass))
+ "Default implementation simply uses the object name of THIS."
+ (object-name-string this))
-(defun rudel-debug-stream-insert (stream tag data &optional object)
- "Insert DATA and possibly OBJECT into stream using TAG as style."
+(defun rudel-debug-write-to-stream (stream tag label data
+ &optional object)
+ "Insert DATA and maybe OBJECT into stream using TAG, LABEL as style."
(let* ((buffer-name (format "*%s stream*" stream))
(buffer (or (get-buffer buffer-name)
(data-debug-new-buffer buffer-name)))
@@ -199,18 +188,203 @@
(or (nth 0 appearance)
'default)))
(prefix (or (nth 1 appearance)
- "")))
+ ""))
+ (string (cond
+ ((stringp data)
+ data)
+ ((object-p data)
+ (object-print data)))))
(save-excursion
(set-buffer buffer)
(goto-char 0)
(insert prefix
- (propertize data 'face face)
- (if (string= (substring data -1) "\n")
+ (if label
+ (format
+ "%-8s"
+ (propertize label 'face 'font-lock-type-face))
+ " ")
+ " "
+ (propertize string 'face face)
+ (if (and (>= (length string) 1)
+ (string= (substring string -1) "\n"))
"" "\n"))
(when object
- (data-debug-insert-thing object prefix ""))))
+ (data-debug-insert-thing
+ object
+ (concat prefix
+ (propertize "OBJECT " 'face 'font-lock-type-face))
+ ""))))
)
+(defun rudel-debug-write (source tag label data &optional object)
+ "Write DATA and OBJECT to debug stream associated to SOURCE.
+TAG and LABEL determine the logging style."
+ (rudel-debug-write-to-stream
+ (rudel-debug-target source) tag label data object))
+
+
+;;; State machine debugging
+;;
+
+(defvar rudel-debug-old-state nil
+ "Saves state of state machines across one function call.")
+
+(defmethod rudel-switch :before
+ ((this rudel-state-machine) state &rest arguments)
+ "Store name of STATE for later printing."
+ (with-slots (state) this
+ (setq rudel-debug-old-state
+ (if state (object-name-string state) "#start")))
+ )
+
+(defmethod rudel-switch :after
+ ((this rudel-state-machine) state &rest arguments)
+ "Log STATE and ARGUMENTS to debug stream."
+ (with-slots (state) this
+ (let ((old-state rudel-debug-old-state)
+ (new-state (object-name-string state)))
+ (unless (string= old-state new-state)
+ (rudel-debug-write
+ this
+ :special
+ "FSM"
+ (if arguments
+ (format "%s -> %s %s" old-state new-state arguments)
+ (format "%s -> %s" old-state new-state))))))
+ )
+
+
+;;; Debugging functions for `rudel-transport-filter'
+;;
+
+(defmethod rudel-debug-target ((this rudel-transport-filter))
+ "Find target of filter THIS by looking at underlying transport."
+ (with-slots (transport) this
+ (rudel-debug-target transport)))
+
+
+;;; Debugging functions for `rudel-assembling-transport-filter'
+;;
+
+(defmethod rudel-set-assembly-function :before
+ ((this rudel-assembling-transport-filter) function)
+ "Log change of assembly function to FUNCTION."
+ (with-slots (socket assembly-function) this
+ (rudel-debug-write
+ this
+ :special
+ "ASSEMBLE"
+ (format "%s -> %s"
+ (symbol-name assembly-function)
+ (symbol-name function))))
+ )
+
+(defmethod rudel-set-filter ((this rudel-assembling-transport-filter)
+ filter1)
+ "Log DATA as it goes through THIS."
+ (with-slots (filter) this
+ (lexical-let ((this1 this)
+ (filter2 filter1))
+ (setq filter (lambda (data)
+ (rudel-debug-write
+ this1
+ :received
+ "ASSEMBLE"
+ data)
+ (funcall filter2 data)))))
+ )
+
+(defmethod rudel-send :before
+ ((this rudel-assembling-transport-filter) data)
+ "Log DATA as it goes through THIS."
+ (rudel-debug-write this :sent "RAW" data nil))
+
+
+;;; Debugging function `rudel-parsing-transport-filter'
+;;
+
+(defmethod rudel-set-parse-function :before
+ ((this rudel-parsing-transport-filter) function)
+ "Log parse function change to FUNCTION."
+ (with-slots (parse-function) this
+ (rudel-debug-write
+ this
+ :special
+ "PARSE"
+ (format "%s -> %s"
+ (symbol-name parse-function)
+ (symbol-name function))))
+ )
+
+(defmethod rudel-set-generate-function :before
+ ((this rudel-parsing-transport-filter) function)
+ "Log generate function change to FUNCTION."
+ (with-slots (generate-function) this
+ (rudel-debug-write
+ this
+ :special
+ "GENERATE"
+ (format "%s -> %s"
+ (symbol-name generate-function)
+ (symbol-name function))))
+ )
+
+(defmethod rudel-set-filter ((this rudel-parsing-transport-filter)
+ filter1)
+ "Log DATA as it goes through THIS."
+ (with-slots (filter) this
+ (lexical-let ((this1 this)
+ (filter2 filter1))
+ (setq filter (lambda (data)
+ (rudel-debug-write
+ this1
+ :received
+ "PARSE"
+ (format "%s" data) data)
+ (funcall filter2 data)))))
+ )
+
+(defmethod rudel-send :before
+ ((this rudel-parsing-transport-filter) string-or-data)
+ "Log STRING-OR-DATA as it goes through THIS."
+ (let ((formatted (cond
+ ((stringp string-or-data)
+ string-or-data)
+
+ ((object-p string-or-data)
+ (object-print string-or-data))
+
+ (t
+ (format "%s" string-or-data)))))
+ (rudel-debug-write
+ this
+ :sent
+ "GENERATE"
+ formatted (unless (stringp string-or-data)
+ string-or-data)))
+ )
+
+
+;;; Socket transport debugging
+;;
+
+(defmethod rudel-set-filter ((this rudel-socket-transport)
+ filter)
+ "Log DATA as it goes through THIS."
+ (lexical-let ((this1 this)
+ (filter1 filter))
+ (oset
+ this :filter
+ (lambda (data)
+ (rudel-debug-write this1 :received "SOCKET" data)
+ (funcall filter1 data))))
+ )
+
+(defmethod rudel-send :before ((this rudel-socket-transport)
+ data)
+ "Log DATA verbatim as it is sent through the socket of THIS."
+ (rudel-debug-write this :sent "SOCKET" data nil))
+
(provide 'rudel-debug)
;; Local Variables:
;; no-byte-compile: t
View
150 xmpp/rudel-xmpp-debug.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2009, 2010 Jan Moringen
;;
;; Author: Jan Moringen <scymtym@users.sourceforge.net>
-;; Keywords: rudel, xmpp, debugging
+;; Keywords: rudel, xmpp, debug
;; X-RCS: $Id:$
;;
;; This file is part of Rudel.
@@ -29,6 +29,8 @@
;;; History:
;;
+;; 0.2 - New debugging infrastructure
+;;
;; 0.1 - Initial version
@@ -42,115 +44,67 @@
(require 'rudel-xmpp)
(require 'rudel-xmpp-util)
+(require 'rudel-xmpp-state)
(require 'rudel-xmpp-sasl)
-;;; Variables
-;;
-
-(defvar rudel-xmpp-debug-old-state nil
- "TODO")
-
-
-;;; Intercept methods of `rudel-xmpp-transport' for logging
+;;; All XMPP states
;;
-(defmethod rudel-send :before ((this rudel-xmpp-transport)
- string-or-xml)
- ""
- (let ((formatted (if (stringp string-or-xml)
- string-or-xml
- (condition-case nil
- (xml->string string-or-xml t)
- (error (format "<could not format XML infoset>\n%s"
- string-or-xml))))))
- (with-slots (socket) this
- (rudel-debug-stream-insert
- (rudel-debug-stream-name socket)
- :sent
- formatted (unless (stringp string-or-xml)
- string-or-xml))))
- )
-
-(defmethod rudel-accept :before ((this rudel-xmpp-transport)
- xml)
- ""
- (with-slots (socket) this
- (let ((formatted (condition-case nil
- (xml->string xml)
- (error (format "<could not format XML infoset>\n%s"
- xml)))))
- (rudel-debug-stream-insert
- (rudel-debug-stream-name socket)
- :received
- formatted xml)))
- )
-
-(defmethod rudel-switch :before ((this rudel-xmpp-transport)
- state &rest arguments)
- ""
- (with-slots (state) this
- (setq rudel-xmpp-debug-old-state
- (if state
- (object-name-string state)
- "#start")))
- )
-
-(defmethod rudel-switch :after ((this rudel-xmpp-transport)
- state &rest arguments)
- ""
- (with-slots (socket state) this
- (let ((old-state rudel-xmpp-debug-old-state)
- (new-state (object-name-string state)))
- (unless (string= old-state new-state)
- (rudel-debug-stream-insert
- (rudel-debug-stream-name socket)
- :special
- (if arguments
- (format "STATE %s -> %s %s" old-state new-state arguments)
- (format "STATE %s -> %s" old-state new-state))))))
- )
+(defmethod rudel-debug-target ((this rudel-xmpp-state))
+ "Return debug target of the transport as debug target for THIS."
+ (with-slots (transport) this
+ (rudel-debug-target transport)))
;;; Handle base64 encoded data in SASL steps
;;
-(defmethod rudel-send :after ((this rudel-xmpp-state-sasl-mechanism-step)
- xml)
- ""
- (when (and (string= (xml-tag-name xml) "response")
- (car-safe (xml-tag-children xml)))
- (with-slots (socket) (oref this :transport) ;; TODO temp impersonating-state solves this
- (mapc
- (lambda (pair)
- (rudel-debug-stream-insert
- (rudel-debug-stream-name socket)
- :sent
- (if (find ?= pair)
- (apply #'format "%-16s: %s" (split-string pair "="))
- pair)))
- (split-string
- (base64-decode-string (car (xml-tag-children xml)))
- ","))))
+(defmethod rudel-send ((this rudel-xmpp-state-sasl-mechanism-step)
+ &rest args)
+ "Delegate sending ARGS to the transport associated with THIS."
+ ;; We need this primary method in order for the :after method below
+ ;; to work as intended. Without this method, the :after method would
+ ;; get called and `no-applicable-method' would not get called.
+ (with-slots (transport) this
+ (apply #'rudel-send transport args)))
+
+(defmethod rudel-send :after
+ ((this rudel-xmpp-state-sasl-mechanism-step) xml)
+ "Show base64-decoded version of XML."
+ (when (and (eq (xml-node-name xml) 'response)
+ (car-safe (xml-node-children xml)))
+ (mapc
+ (lambda (pair)
+ (rudel-debug-write
+ this
+ :sent
+ "RESPDATA"
+ (if (find ?= pair)
+ (apply #'format "%-16s: %s" (split-string pair "="))
+ pair)))
+ (split-string
+ (base64-decode-string (car (xml-node-children xml)))
+ ",")))
)
-(defmethod rudel-accept :before ((this rudel-xmpp-state-sasl-mechanism-step)
- xml)
- ""
- (when (and (string= (xml-tag-name xml) "challenge")
- (car-safe (xml-tag-children xml)))
- (with-slots (socket) (oref this :transport) ;; TODO temp impersonating-state solves this
- (mapc
- (lambda (pair)
- (rudel-debug-stream-insert
- (rudel-debug-stream-name socket)
- :received
- (if (find ?= pair)
- (apply #'format "%-16s: %s" (split-string pair "="))
- pair)))
- (split-string
- (base64-decode-string (car (xml-tag-children xml)))
- ","))))
+(defmethod rudel-accept :before
+ ((this rudel-xmpp-state-sasl-mechanism-step) xml)
+ "Show base64-decoded version of XML."
+ (when (and (eq (xml-node-name xml) 'challenge)
+ (stringp (car-safe (xml-node-children xml))))
+ (mapc
+ (lambda (pair)
+ (rudel-debug-write
+ this
+ :received
+ "CHALDATA"
+ (if (find ?= pair)
+ (apply #'format "%-16s: %s" (split-string pair "="))
+ pair)))
+ (split-string
+ (base64-decode-string (car (xml-node-children xml)))
+ ",")))
)
(provide 'rudel-xmpp-debug)
Please sign in to comment.
Something went wrong with that request. Please try again.