Skip to content

Commit

Permalink
handle invalid input from wsproxy clients better
Browse files Browse the repository at this point in the history
  • Loading branch information
3b committed Jun 4, 2011
1 parent a2daaca commit ebdcdbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wsproxy.lisp
Expand Up @@ -42,10 +42,10 @@ to do with swank proxy."
(defmethod ws:resource-received-frame ((res swank-proxy-resource) client message)
(when (find client (resource-clients res))
(let* ((string-for-emacs (format nil "[~s] ~s~%" (position client (resource-clients res)) message))
(r (yason:parse message))
(result (gethash "RESULT" r))
(id (gethash "ID" r))
(err (gethash "ERROR" r)))
(r (ignore-errors (yason:parse message)))
(result (when (and r (hash-table-p r)) (gethash "RESULT" r)))
(id (when (and r (hash-table-p r)) (gethash "ID" r)))
(err (when (and r (hash-table-p r)) (gethash "ERROR" r))))
#++(format t "got frame ~s (~s)~%" data s)
#++(format t "got response ~s . ~s / ~s~%" result id err)
(if id
Expand Down

0 comments on commit ebdcdbb

Please sign in to comment.