From ehuelsmann at common-lisp.net Sun Sep 23 09:50:08 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 02:50:08 -0700 Subject: [cl-irc-cvs] r219 - trunk Message-ID: Author: ehuelsmann Date: Sun Sep 23 02:50:06 2012 New Revision: 219 Log: Fix long-standing complaint that cl-irc hits the debugger on unknown (and, as Matthew Emerson puts it, irrelevant) response codes. * parse-message.lisp: (find-reply-name): Simply return the reply name. (create-irc-message): If there's no reply name, raise an error. * protocol.lisp: (read-irc-message, read-message, read-message-loop): restructure condition handling for END-OF-FILE and NO-SUCH-REPLY to eliminate "trickery" (returning values which mean different things than what they are) * variable.lisp: (*unknown-reply-hook*): New variable for function to catch unhandled replies. Defaults to ignore unhandled replies. Modified: trunk/parse-message.lisp trunk/protocol.lisp trunk/variable.lisp Modified: trunk/parse-message.lisp ============================================================================== --- trunk/parse-message.lisp Sat Aug 18 14:58:37 2012 (r218) +++ trunk/parse-message.lisp Sun Sep 23 02:50:06 2012 (r219) @@ -12,12 +12,8 @@ (`no-such-reply') which gives you the opportunity to ignore the situation." (let ((name (assoc reply-number reply-names))) - (if name - (cadr name) - (progn - (cerror "Ignore unknown reply." - 'no-such-reply :reply-number reply-number) - :unknown-reply)))) + (when name + (cadr name)))) (defun return-source (string &key (start 0)) "Assuming `string' is a valid IRC message this function returns the @@ -198,14 +194,17 @@ ;; (setf command (find-reply-name (parse-integer command))) ;; (setf class 'irc-error-reply))) ((numeric-reply-p command) - (progn - (setf command (find-reply-name (parse-integer command))) + (let* ((reply-number (parse-integer command)) + (reply-name (find-reply-name reply-number))) + (unless reply-name + (error "Ignore unknown reply." + 'no-such-reply :reply-number reply-number)) + (setf command reply-name) (setf class (find-irc-message-class command)))) (t - (progn - (setf command (intern (string-upcase command) - (find-package :keyword))) - (setf class (find-irc-message-class command)))))) + (setf command (intern (string-upcase command) + (find-package :keyword))) + (setf class (find-irc-message-class command))))) (when ctcp (setf class (find-ctcp-message-class ctcp))) (let ((instance (make-instance class Modified: trunk/protocol.lisp ============================================================================== --- trunk/protocol.lisp Sat Aug 18 14:58:37 2012 (r218) +++ trunk/protocol.lisp Sun Sep 23 02:50:06 2012 (r219) @@ -280,8 +280,8 @@ (when *debug-p* (format *debug-stream* "~A" (describe message))) (when message - (irc-message-event connection message)) - message))) ; needed because of the "loop while" in read-message-loop + (irc-message-event connection message))) + t)) ;; connected -> continue processing (defvar *process-count* 0) @@ -311,34 +311,21 @@ (flet ((select-handler (fd) (declare (ignore fd)) (if (listen (network-stream connection)) - (handler-bind - ;; install sensible recovery: nobody can wrap the - ;; handler... - ((no-such-reply - #'(lambda (c) - (declare (ignore c)) - (invoke-restart 'continue)))) - (read-message connection)) - ;; select() returns with no - ;; available data if the stream - ;; has been closed on the other - ;; end (EPIPE) - (sb-sys:invalidate-descriptor - (sb-sys:fd-stream-fd - (network-stream connection)))))) + (read-message connection) + ;; select() returns with no + ;; available data if the stream + ;; has been closed on the other + ;; end (EPIPE) + (sb-sys:invalidate-descriptor + (sb-sys:fd-stream-fd + (network-stream connection)))))) (sb-sys:add-fd-handler (sb-sys:fd-stream-fd (network-stream connection)) :input #'select-handler)) #-(and sbcl (not sb-thread)) (flet ((do-loop () - (loop - (handler-bind - ((no-such-reply - #'(lambda (c) - (declare (ignore c)) - (invoke-restart 'continue)))) - (read-message-loop connection))))) + (read-message-loop connection))) (let ((name (format nil "irc-handler-~D" (incf *process-count*)))) (start-process #'do-loop name)))) @@ -357,19 +344,23 @@ (defgeneric read-message-loop (connection)) (defmethod read-message-loop (connection) - (loop while (read-message connection))) + (handler-bind + (loop while (read-message connection)) + (end-of-file () nil))) (defmethod read-irc-message ((connection connection)) - "Read and parse an IRC-message from the `connection'." - (handler-case - (let* ((msg-string (read-protocol-line connection)) - (message (when msg-string (create-irc-message msg-string)))) - (when message (setf (connection message) connection)) - message) - (end-of-file - ;; satisfy read-message-loop assumption of nil when no more messages - ()))) + "Read and parse an IRC message from the `connection'." + (let* ((msg-string (read-protocol-line connection)) + (message (when msg-string + (handler-case + (create-irc-message msg-string) + (no-such-reply () + (when *unknown-reply-hook* + (funcall *unknown-reply-hook* + connection msg-string))))))) + (when message (setf (connection message) connection)) + message)) (defmethod send-irc-message ((connection connection) command Modified: trunk/variable.lisp ============================================================================== --- trunk/variable.lisp Sat Aug 18 14:58:37 2012 (r218) +++ trunk/variable.lisp Sun Sep 23 02:50:06 2012 (r219) @@ -15,8 +15,8 @@ (format nil "CL IRC library, cl-irc:~A:~A ~A" *version* (machine-type) (machine-version))) -(defparameter *download-host* "ftp://common-lisp.net/") -(defparameter *download-directory* "/pub/project/cl-irc/") +(defparameter *download-host* "http://common-lisp.net/") +(defparameter *download-directory* "/project/cl-irc/") (defparameter *download-file* (format nil "cl-irc-~A.tar.gz" *version*)) @@ -28,6 +28,15 @@ (defvar *default-quit-message* "Common Lisp IRC library - http://common-lisp.net/project/cl-irc") +(defparameter *unknown-reply-hook* nil + "A function of two arguments, called with the related irc connection +object and the protocol message string upon detection of an unmappable +response code. + +The function should return a valid IRC-MESSAGE class or NIL. + +The parameter can be NIL to disable the hook.") + (defparameter *default-isupport-CHANMODES* "beI,kO,l,aimnpqsrt") (defparameter *default-isupport-PREFIX* From ehuelsmann at common-lisp.net Sun Sep 23 10:44:13 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 03:44:13 -0700 Subject: [cl-irc-cvs] r220 - branches/0.9.0 Message-ID: Author: ehuelsmann Date: Sun Sep 23 03:44:12 2012 New Revision: 220 Log: Create 0.9.0 release tag. Added: branches/0.9.0/ - copied from r219, trunk/ From ehuelsmann at common-lisp.net Sun Sep 23 10:44:54 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 03:44:54 -0700 Subject: [cl-irc-cvs] r221 - branches/0.9.0 Message-ID: Author: ehuelsmann Date: Sun Sep 23 03:44:54 2012 New Revision: 221 Log: Delete incomplete tag. Deleted: branches/0.9.0/ From ehuelsmann at common-lisp.net Sun Sep 23 10:47:10 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 03:47:10 -0700 Subject: [cl-irc-cvs] r222 - tags/0.9.0 Message-ID: Author: ehuelsmann Date: Sun Sep 23 03:47:09 2012 New Revision: 222 Log: Create 0.9.0 tag with correct version info. Added: tags/0.9.0/ - copied from r221, trunk/ Modified: tags/0.9.0/variable.lisp Modified: tags/0.9.0/variable.lisp ============================================================================== --- trunk/variable.lisp Sun Sep 23 03:44:54 2012 (r221) +++ tags/0.9.0/variable.lisp Sun Sep 23 03:47:09 2012 (r222) @@ -10,7 +10,7 @@ (defconstant +soh+ #.(code-char 1)) -(defparameter *version* "0.8.0-dev") +(defparameter *version* "0.9.0") (defparameter *ctcp-version* (format nil "CL IRC library, cl-irc:~A:~A ~A" *version* (machine-type) (machine-version))) From ehuelsmann at common-lisp.net Sun Sep 23 10:52:36 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 03:52:36 -0700 Subject: [cl-irc-cvs] r223 - trunk Message-ID: Author: ehuelsmann Date: Sun Sep 23 03:52:35 2012 New Revision: 223 Log: Promote trunk to 0.9.1-dev, following the tag of 0.9.0. Modified: trunk/variable.lisp Modified: trunk/variable.lisp ============================================================================== --- trunk/variable.lisp Sun Sep 23 03:47:09 2012 (r222) +++ trunk/variable.lisp Sun Sep 23 03:52:35 2012 (r223) @@ -10,7 +10,7 @@ (defconstant +soh+ #.(code-char 1)) -(defparameter *version* "0.8.0-dev") +(defparameter *version* "0.9.1-dev") (defparameter *ctcp-version* (format nil "CL IRC library, cl-irc:~A:~A ~A" *version* (machine-type) (machine-version))) From ehuelsmann at common-lisp.net Sun Sep 23 11:01:30 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 04:01:30 -0700 Subject: [cl-irc-cvs] r224 - in public_html: . releases Message-ID: Author: ehuelsmann Date: Sun Sep 23 04:01:28 2012 New Revision: 224 Log: Publish 0.9.0. Added: public_html/releases/cl-irc-0.9.0.tar.gz (contents, props changed) Modified: public_html/index.html public_html/releases/cl-irc_latest.tar.gz public_html/releases/cl-irc_latest.tar.gz.asc Modified: public_html/index.html ============================================================================== --- public_html/index.html Sun Sep 23 03:52:35 2012 (r223) +++ public_html/index.html Sun Sep 23 04:01:28 2012 (r224) @@ -5,7 +5,7 @@
-

cl-irc 0.8.1

+

cl-irc 0.9.0

@@ -28,6 +28,7 @@

News

    +
  • Version 0.9.0 released (lots of fixes)
  • Version 0.8.1 released (small fixes: KICK message processing, channel mode tracking)
  • Version 0.8.0 released (user and channel mode tracking, characterset support on the irc network)
  • Version 0.7.0 released (RPL_ISUPPORT, many small tweaks and fixes)
  • Added: public_html/releases/cl-irc-0.9.0.tar.gz ============================================================================== Binary file. No diff available. Modified: public_html/releases/cl-irc_latest.tar.gz ============================================================================== --- public_html/releases/cl-irc_latest.tar.gz Sun Sep 23 03:52:35 2012 (r223) +++ public_html/releases/cl-irc_latest.tar.gz Sun Sep 23 04:01:28 2012 (r224) @@ -1 +1 @@ -link cl-irc-0.8.1.tar.gz \ No newline at end of file +link cl-irc-0.9.0.tar.gz \ No newline at end of file Modified: public_html/releases/cl-irc_latest.tar.gz.asc ============================================================================== --- public_html/releases/cl-irc_latest.tar.gz.asc Sun Sep 23 03:52:35 2012 (r223) +++ public_html/releases/cl-irc_latest.tar.gz.asc Sun Sep 23 04:01:28 2012 (r224) @@ -1 +1 @@ -link cl-irc-0.8.1.tar.gz.asc \ No newline at end of file +link cl-irc-0.9.0.tar.gz.asc \ No newline at end of file From ehuelsmann at common-lisp.net Sun Sep 23 11:35:54 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 04:35:54 -0700 Subject: [cl-irc-cvs] r225 - public_html/releases Message-ID: Author: ehuelsmann Date: Sun Sep 23 04:35:53 2012 New Revision: 225 Log: Add signature file for 0.9.0. Added: public_html/releases/cl-irc-0.9.0.tar.gz.asc Added: public_html/releases/cl-irc-0.9.0.tar.gz.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/cl-irc-0.9.0.tar.gz.asc Sun Sep 23 04:35:53 2012 (r225) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAlBe7wQACgkQi5O0Epaz9TkHYgCeN9z8T76lgwPVWaIQYmxkXqsw +VTwAn3ILNWQGlqj8UUyI+6P43rLETmjR +=S5TH +-----END PGP SIGNATURE----- From ehuelsmann at common-lisp.net Sun Sep 23 14:32:22 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 07:32:22 -0700 Subject: [cl-irc-cvs] r226 - trunk Message-ID: Author: ehuelsmann Date: Sun Sep 23 07:32:21 2012 New Revision: 226 Log: Use HANDLER-CASE where HANDLER-CASE was meant to be used. Modified: trunk/protocol.lisp Modified: trunk/protocol.lisp ============================================================================== --- trunk/protocol.lisp Sun Sep 23 04:35:53 2012 (r225) +++ trunk/protocol.lisp Sun Sep 23 07:32:21 2012 (r226) @@ -344,7 +344,7 @@ (defgeneric read-message-loop (connection)) (defmethod read-message-loop (connection) - (handler-bind + (handler-case (loop while (read-message connection)) (end-of-file () nil))) From ehuelsmann at common-lisp.net Sun Sep 23 16:14:52 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 09:14:52 -0700 Subject: [cl-irc-cvs] r227 - trunk Message-ID: Author: ehuelsmann Date: Sun Sep 23 09:14:50 2012 New Revision: 227 Log: Threading now located in the THREADS package on abcl. Modified: trunk/protocol.lisp Modified: trunk/protocol.lisp ============================================================================== --- trunk/protocol.lisp Sun Sep 23 07:32:21 2012 (r226) +++ trunk/protocol.lisp Sun Sep 23 09:14:50 2012 (r227) @@ -294,7 +294,7 @@ #+lispworks (mp:process-run-function name nil function) #+sb-thread (sb-thread:make-thread function :name name) #+openmcl (ccl:process-run-function name function) - #+armedbear (ext:make-thread function)) + #+armedbear (threads:make-thread function)) (defun start-background-message-handler (connection) "Read messages from the `connection', parse them and dispatch @@ -340,7 +340,7 @@ #+sb-thread (sb-thread:destroy-thread process) #+lispworks (mp:process-kill process) #+openmcl (ccl:process-kill process) - #+armedbear (ext:destroy-thread process)) + #+armedbear (threads:destroy-thread process)) (defgeneric read-message-loop (connection)) (defmethod read-message-loop (connection) From ehuelsmann at common-lisp.net Sun Sep 23 16:21:53 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 09:21:53 -0700 Subject: [cl-irc-cvs] r229 - trunk Message-ID: Author: ehuelsmann Date: Sun Sep 23 09:21:52 2012 New Revision: 229 Log: Increase version number(s) after tagging 0.9.1. Modified: trunk/cl-irc.asd trunk/variable.lisp Modified: trunk/cl-irc.asd ============================================================================== --- trunk/cl-irc.asd Sun Sep 23 09:20:09 2012 (r228) +++ trunk/cl-irc.asd Sun Sep 23 09:21:52 2012 (r229) @@ -13,7 +13,7 @@ (defsystem cl-irc :name "cl-irc" :author "Erik Enge & Contributors" - :version "0.8-dev" + :version "0.9.2-dev" :licence "MIT" :description "Common Lisp interface to the IRC protocol" :depends-on (:split-sequence :usocket :flexi-streams) Modified: trunk/variable.lisp ============================================================================== --- trunk/variable.lisp Sun Sep 23 09:20:09 2012 (r228) +++ trunk/variable.lisp Sun Sep 23 09:21:52 2012 (r229) @@ -10,7 +10,7 @@ (defconstant +soh+ #.(code-char 1)) -(defparameter *version* "0.9.1-dev") +(defparameter *version* "0.9.2-dev") (defparameter *ctcp-version* (format nil "CL IRC library, cl-irc:~A:~A ~A" *version* (machine-type) (machine-version))) From ehuelsmann at common-lisp.net Sun Sep 23 16:27:22 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 09:27:22 -0700 Subject: [cl-irc-cvs] r230 - in public_html: . releases Message-ID: Author: ehuelsmann Date: Sun Sep 23 09:27:20 2012 New Revision: 230 Log: Publish 0.9.1. Added: public_html/releases/cl-irc-0.9.1.tar.gz (contents, props changed) Modified: public_html/index.html public_html/releases/cl-irc_latest.tar.gz public_html/releases/cl-irc_latest.tar.gz.asc Modified: public_html/index.html ============================================================================== --- public_html/index.html Sun Sep 23 09:21:52 2012 (r229) +++ public_html/index.html Sun Sep 23 09:27:20 2012 (r230) @@ -5,7 +5,7 @@
    -

    cl-irc 0.9.0

    +

    cl-irc 0.9.1

    @@ -28,7 +28,7 @@

    News

      -
    • Version 0.9.0 released (lots of fixes)
    • +
    • Version 0.9.1 released (lots of fixes)
    • Version 0.8.1 released (small fixes: KICK message processing, channel mode tracking)
    • Version 0.8.0 released (user and channel mode tracking, characterset support on the irc network)
    • Version 0.7.0 released (RPL_ISUPPORT, many small tweaks and fixes)
    • Added: public_html/releases/cl-irc-0.9.1.tar.gz ============================================================================== Binary file. No diff available. Modified: public_html/releases/cl-irc_latest.tar.gz ============================================================================== --- public_html/releases/cl-irc_latest.tar.gz Sun Sep 23 09:21:52 2012 (r229) +++ public_html/releases/cl-irc_latest.tar.gz Sun Sep 23 09:27:20 2012 (r230) @@ -1 +1 @@ -link cl-irc-0.9.0.tar.gz \ No newline at end of file +link cl-irc-0.9.1.tar.gz \ No newline at end of file Modified: public_html/releases/cl-irc_latest.tar.gz.asc ============================================================================== --- public_html/releases/cl-irc_latest.tar.gz.asc Sun Sep 23 09:21:52 2012 (r229) +++ public_html/releases/cl-irc_latest.tar.gz.asc Sun Sep 23 09:27:20 2012 (r230) @@ -1 +1 @@ -link cl-irc-0.9.0.tar.gz.asc \ No newline at end of file +link cl-irc-0.9.1.tar.gz.asc \ No newline at end of file From ehuelsmann at common-lisp.net Sun Sep 23 16:44:46 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Sep 2012 09:44:46 -0700 Subject: [cl-irc-cvs] r231 - public_html/releases Message-ID: Author: ehuelsmann Date: Sun Sep 23 09:44:44 2012 New Revision: 231 Log: Add 0.9.1 signature file. Added: public_html/releases/cl-irc-0.9.1.tar.gz.asc Added: public_html/releases/cl-irc-0.9.1.tar.gz.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/cl-irc-0.9.1.tar.gz.asc Sun Sep 23 09:44:44 2012 (r231) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAlBfN8UACgkQi5O0Epaz9TkD/wCfeR07QtUjzVaw5zsGNPFMrOw8 +IQ4AnR4ZVTFQjhJxMSiLhL3kqnA+gaaG +=kdQB +-----END PGP SIGNATURE-----