Skip to content

Commit

Permalink
Modify interface to (hopefully) make send-mail work.
Browse files Browse the repository at this point in the history
  • Loading branch information
drewc committed Dec 4, 2023
1 parent fe7f21b commit 4b3644c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/std/net/smtp/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ https://datatracker.ietf.org/doc/html/rfc5321
(export #t)

(interface (SMTP Socket)
(send-mail return-path forward-path)
(send-mail return-path forward-path . data)
(send-command cmd)
(read-all) (read-lines) (keywords)
(socket) (reader) (writer)
Expand Down Expand Up @@ -604,7 +604,7 @@ https://datatracker.ietf.org/doc/html/rfc5321
(defstruct session (address sock reader writer) constructor: :init!)
;;; Socket interface implementation passhtrough
(defmethod {socket session}
(lambda (self) (using (s self : session) s.sock)) rebind: #t)
(lambda (self) (using (s self : session) s.sock)))
(defmethod {reader session}
(lambda (self) (using (s self :- session) s.reader)))
(defmethod {writer session}
Expand Down Expand Up @@ -689,7 +689,7 @@ https://datatracker.ietf.org/doc/html/rfc5321
((string? thing) (send-command sess (->u8vector thing)))
(else (error "Trying to send a non-u8vector or non-string" thing))))

(defmethod {send-command session} send-command rebind: #t)
(defmethod {send-command session} send-command)

#+end_src

Expand Down Expand Up @@ -733,7 +733,7 @@ https://datatracker.ietf.org/doc/html/rfc5321
(else (cons (->s u8v start (- crlf 1))
(readln (+ 1 crlf)))))))))

(defmethod {read-lines session} session-read-lines rebind: #t)
(defmethod {read-lines session} session-read-lines)
#+end_src


Expand Down
2 changes: 1 addition & 1 deletion src/std/net/smtp/interface.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(export #t)

(interface (SMTP Socket)
(send-mail return-path forward-path)
(send-mail return-path forward-path . data)
(send-command cmd)
(read-all) (read-lines) (keywords)
(socket) (reader) (writer)
Expand Down
6 changes: 3 additions & 3 deletions src/std/net/smtp/session.ss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(defstruct session (address sock reader writer) constructor: :init!)
;;; Socket interface implementation passhtrough
(defmethod {socket session}
(lambda (self) (using (s self : session) s.sock)) rebind: #t)
(lambda (self) (using (s self : session) s.sock)))
(defmethod {reader session}
(lambda (self) (using (s self :- session) s.reader)))
(defmethod {writer session}
Expand Down Expand Up @@ -73,7 +73,7 @@
((string? thing) (send-command sess (->u8vector thing)))
(else (error "Trying to send a non-u8vector or non-string" thing))))

(defmethod {send-command session} send-command rebind: #t)
(defmethod {send-command session} send-command)

(def (u8vector-find-crlf u8v (start 0))
(def len (u8vector-length u8v))
Expand All @@ -95,4 +95,4 @@
(else (cons (->s u8v start (- crlf 1))
(readln (+ 1 crlf)))))))))

(defmethod {read-lines session} session-read-lines rebind: #t)
(defmethod {read-lines session} session-read-lines)

0 comments on commit 4b3644c

Please sign in to comment.