mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
Guard against ill-formed responses in snow remote-command.
This commit is contained in:
parent
3716d99a02
commit
c437ede235
1 changed files with 12 additions and 4 deletions
|
@ -794,10 +794,18 @@
|
||||||
(http-post uri params))))
|
(http-post uri params))))
|
||||||
|
|
||||||
(define (remote-command cfg name path params)
|
(define (remote-command cfg name path params)
|
||||||
(let ((uri (remote-uri cfg name path)))
|
(let* ((uri (remote-uri cfg name path))
|
||||||
(sxml-display-as-text
|
(response
|
||||||
(read (snow-post cfg uri (cons '(fmt . "sexp") params))))
|
(port->string (snow-post cfg uri (cons '(fmt . "sexp") params)))))
|
||||||
(newline)))
|
(guard (exn (else
|
||||||
|
(display "ERROR: couldn't display sxml response: ")
|
||||||
|
(write response)
|
||||||
|
(newline)))
|
||||||
|
(let ((sxml (call-with-input-string response read)))
|
||||||
|
(if (null? sxml)
|
||||||
|
(display "WARN: () response from server")
|
||||||
|
(sxml-display-as-text sxml))
|
||||||
|
(newline)))))
|
||||||
|
|
||||||
(define (command/reg-key cfg spec)
|
(define (command/reg-key cfg spec)
|
||||||
(let* ((keys (call-with-input-file
|
(let* ((keys (call-with-input-file
|
||||||
|
|
Loading…
Add table
Reference in a new issue