Commit f94dd2f7 authored by Zach Beane's avatar Zach Beane
Browse files

Hack upon hack to progress.

Things "work" enough to start to get chunking errors.
parent 0e15afc5
......@@ -262,13 +262,51 @@ values otherwise."
&rest initargs &key &allow-other-keys)
(excl:device-open stream slot-names initargs))
(defgeneric underlying-output-stream (stream)
(:method ((stream excl:single-channel-simple-stream))
(underlying-output-stream (slot-value stream 'excl::output-handle)))
(:method ((stream stream-usocket))
(socket-stream stream))
(:method ((stream usocket))
(socket-stream stream))
(:method ((stream stream))
stream))
(defgeneric underlying-input-stream (stream)
(:method ((stream excl:single-channel-simple-stream))
(underlying-input-stream (slot-value stream 'excl::input-handle)))
(:method ((stream usocket))
(socket-stream stream))
(:method ((stream stream))
stream))
(defmethod stream-write-string ((stream excl:single-channel-simple-stream) string &optional start end )
(unless start (setf start 0))
(unless end (setf end (length string)))
(write-string string (socket-stream (slot-value stream 'excl::output-handle))
(write-string string (underlying-output-stream stream)
:start start
:end end))
(defmethod ccl:stream-write-vector ((stream excl:single-channel-simple-stream) sequence start end)
(unless start (setf start 0))
(unless end (setf end (length sequence)))
(write-sequence sequence (underlying-output-stream stream)))
(defmethod stream-force-output ((stream excl:single-channel-simple-stream))
(force-output (underlying-output-stream stream)))
(defmethod stream-force-output ((stream usocket))
(force-output (underlying-output-stream stream)))
(defmethod stream-read-char ((stream usocket))
(stream-read-char (socket-stream stream)))
(defmethod stream-read-byte ((stream usocket))
(stream-read-byte (socket-stream stream)))
(defmethod cl:close ((stream usocket) &key abort)
(close (socket-stream stream) :abort abort))
(defmacro excl:add-stream-instance-flags (stream &rest flags)
(declare (ignore stream flags))
nil)
......@@ -279,3 +317,13 @@ values otherwise."
(write-sequence vector stream :start start :end end)
end)
(defmethod excl::socket-bytes-written (socket &optional set)
(declare (ignore socket))
(or set
42))
(defmacro excl:pop-atomic (place)
`(pop ,place))
(defmacro excl:push-atomic (value place)
`(push ,value ,place ))
......@@ -12,6 +12,9 @@
(:default-initargs
:plist nil))
(defmethod real-uri ((uri quri:uri))
uri)
(defun net.uri:uri-path (uri)
(uri-path (real-uri uri)))
......
......@@ -4,3 +4,9 @@
(defmacro si:without-scheduling (&body body)
`(excl:without-interrupts ,@body))
(defun si:global-symbol-value (symbol)
(symbol-value symbol))
(defun (setf si:global-symbol-value) (new-value symbol)
(setf (symbol-value symbol) new-value))
......@@ -48,6 +48,7 @@
#:get-peer-address
#:usocket-p
#:usocket
#:stream-usocket
#:socket-stream)
(:import-from #:bordeaux-threads
#:make-thread
......@@ -67,8 +68,10 @@
#:stream-read-char
#:stream-write-char
#:stream-write-string
#:stream-write-sequence
#:stream-read-byte
#:stream-read-byte)
#:stream-read-byte
#:stream-force-output)
(:import-from #:trivial-garbage
#:make-weak-hash-table
#:finalize)
......@@ -119,12 +122,15 @@
#:with-dynamic-extend-usb8-array
#:unix-signal
#:make-basic-lock
#:*std-control-out-table*)
#:*std-control-out-table*
#:socket-bytes-written)
(:export #:if*
#:then
#:thenret
#:else)
(:export #:single-channel-simple-stream
(:export #:pop-atomic
#:push-atomic
#:single-channel-simple-stream
#:device-open
#:device-close
#:device-read
......
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