abort if bad HTTP reply

svn: r1520
This commit is contained in:
Eli Barzilay 2005-12-04 19:18:04 +00:00
parent e1cf51dea0
commit ef87bdc876

View File

@ -15,7 +15,8 @@
(fprintf o "GET ~a HTTP/1.0\r\nHost: ~a\r\n\r\n" path host)
(flush-output o)
(close-output-port o)
(regexp-match #rx"^HTTP/[0-9.]+ 200 OK\r\n.*?\r\n\r\n" i)
(unless (regexp-match #rx"^HTTP/[0-9.]+ 200 OK\r\n.*?\r\n\r\n" i)
(error 'url->port "bad reply from server: ~a" (read-line)))
i)
(define error-value