Commit 10fe2d2c authored by Zach Beane's avatar Zach Beane
Browse files

Get enough working for simple DO-HTTP-REQUEST.

parent 9fa38241
......@@ -14,7 +14,7 @@
(let ((entry (assoc external-format *external-format-translations*)))
(if entry
(cdr entry)
external-format)))
:utf-8)))
(defvar excl:*initial-terminal-io* *terminal-io*)
......
......@@ -47,14 +47,28 @@
(setf end (length sequence)))
(write-sequence sequence (real-stream stream) :start start :end end))
(defmethod stream-read-byte ((stream zacl-socket))
(read-byte (real-stream stream) nil :eof))
(defmethod stream-read-char ((stream zacl-socket))
(let ((byte (read-byte (real-stream stream) nil :eof)))
(if (eql byte :eof)
:eof
(code-char byte))))
(defmethod stream-read-byte ((stream zacl-socket))
(read-byte (real-stream stream) nil :eof))
(defmethod stream-read-sequence ((stream zacl-socket) sequence start end
&key &allow-other-keys)
(when (stringp sequence)
(error "Not implemented"))
(unless start (setf start 0))
(unless end (setf end (length sequence)))
(read-sequence sequence (real-stream stream) :start start :end end))
#+ccl
(defmethod ccl:stream-read-vector ((stream zacl-socket) sequence start end)
(unless start (setf start 0))
(unless end (setf end (length sequence)))
(read-sequence sequence (real-stream stream) :start start :end end))
(defmethod stream-force-output ((stream zacl-socket))
(force-output (socket-stream (socket stream))))
......@@ -78,7 +92,9 @@
:socket socket)))
((nil)
(let ((socket
(socket-connect remote-host remote-port :nodelay nodelay)))
(socket-connect remote-host remote-port
:nodelay nodelay
:element-type '(unsigned-byte 8))))
(make-instance 'zacl-socket
:socket socket
:real-stream (socket-stream socket))))))
......
......@@ -69,13 +69,13 @@
#:fundamental-binary-input-stream
#:fundamental-character-output-stream
#:fundamental-character-input-stream
#:stream-read-char
#:stream-write-char
#:stream-write-byte
#:stream-write-string
#:stream-write-sequence
#:stream-read-char
#:stream-read-byte
#:stream-read-byte
#:stream-read-sequence
#:stream-force-output)
(:import-from #:trivial-garbage
#:make-weak-hash-table
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment