Browse code

Fix minor typos etc

Jaidyn Levesque authored on 2019-11-11 07:08:06
Showing 1 changed files
... ...
@@ -160,22 +160,22 @@
160 160
 
161 161
 ;; —————————————————
162 162
 
163
-(defgeneric close-it (target con-list on-disconnect)
163
+(defgeneric close-it (target &optional con-list on-disconnect)
164 164
   (:documentation "Shut down a target's connection, forcefully.
165 165
                   Run the disconnect function as well."))
166 166
 
167 167
 ;; CONNECTION LIST-OF-CONNECTIONS FUNCTION
168
-(defmethod close-it ((con connection) connection-list on-disconnect)
169
-  (close (con→stream con) connection-list on-disconnect))
168
+(defmethod close-it ((con connection) &optional connection-list on-disconnect)
169
+  (close-it (con→socket con) connection-list on-disconnect))
170 170
 
171 171
 ;; STREAM-USOCKET LIST-OF-CONNECTIONS FUNCTION
172
-(defmethod close-it ((socket usocket:stream-usocket) connection-list on-disconnect)
173
-  (funcall on-disconnect socket connection-list)
172
+(defmethod close-it ((socket usocket:stream-usocket) &optional connection-list on-disconnect)
173
+  (when connection-list (funcall on-disconnect socket connection-list))
174 174
   (handler-case
175 175
       (usocket:socket-close socket)
176 176
     (error (e)
177 177
       (logger "Ignoring the error from closing connection: ~a" e)))
178
-  (logger "Connection closed: ~A" con))
178
+  (logger "Connection closed: ~A" socket))
179 179
 
180 180
 ;; —————————————————
181 181