|
|
|
@ -56,9 +56,6 @@
|
|
|
|
|
frame (from top to bottom) will be read. If there are no
|
|
|
|
|
frames in the buffer, nil will be returned."
|
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (search-forward "\r" nil t)
|
|
|
|
|
(replace-match ""))
|
|
|
|
|
(let ((frame ())
|
|
|
|
|
(headers-end-point (stomp-find-headers-end-point buffer))
|
|
|
|
|
(frame-end-point (stomp-find-frame-end-point buffer)))
|
|
|
|
@ -84,13 +81,13 @@
|
|
|
|
|
(t (stomp-read-headers buffer end-point
|
|
|
|
|
(map-put headers
|
|
|
|
|
(car header)
|
|
|
|
|
(replace-regexp-in-string "\n$" "" (car (last header))))))))))
|
|
|
|
|
(replace-regexp-in-string "\\(\n\\|\r\n\\)$" "" (car (last header))))))))))
|
|
|
|
|
|
|
|
|
|
(defun stomp-find-frame-end-point (buffer)
|
|
|
|
|
"Find the null byte at the end of a STOMP frame"
|
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward "\u0000")
|
|
|
|
|
(search-forward-regexp "\u0000\\|\u0000\r")
|
|
|
|
|
(- (point) 1)))
|
|
|
|
|
|
|
|
|
|
(defun stomp-find-headers-end-point (buffer)
|
|
|
|
@ -98,7 +95,7 @@
|
|
|
|
|
(with-current-buffer buffer
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(condition-case nil
|
|
|
|
|
(progn (search-forward-regexp "^$") (line-end-position))
|
|
|
|
|
(progn (search-forward-regexp "^\\(\\|\r\\)$") (line-end-position))
|
|
|
|
|
(error nil))))
|
|
|
|
|
|
|
|
|
|
(defun stomp-frame-to-string (frame)
|
|
|
|
|