Update of /project/lisppaste/cvsroot/lisppaste2 In directory common-lisp.net:/home/bmastenbrook/lisppaste2
Modified Files: xml-paste.lisp Log Message: paste maximum size
Date: Fri May 21 17:29:22 2004 Author: bmastenbrook
Index: lisppaste2/xml-paste.lisp diff -u lisppaste2/xml-paste.lisp:1.4 lisppaste2/xml-paste.lisp:1.5 --- lisppaste2/xml-paste.lisp:1.4 Tue Apr 27 17:47:32 2004 +++ lisppaste2/xml-paste.lisp Fri May 21 17:29:22 2004 @@ -25,34 +25,37 @@ "Error: all arguments must be strings." (if (not (every (lambda (s) (> (length s) 0)) (list paste-channel paste-user paste-title paste-contents))) "Error: all arguments must be non-empty strings." - (let ((annotate-this (if annotate (find annotate *pastes* :key #'paste-number))) - (paste-contents (remove #\return paste-contents))) - (if (if annotate - (not (string-equal paste-channel (paste-channel annotate-this))) - (not (member paste-channel *channels* :test #'string-equal))) - (format nil "Error: invalid channel ~S." paste-channel) - (let* ((number (if annotate - (incf (paste-annotation-counter annotate-this)) - (incf *paste-counter*))) - (url (araneida:urlstring - (araneida:merge-url *display-paste-url* - (if annotate - (format nil "~A#~A" - (paste-number annotate-this) - number) - (prin1-to-string number)))))) - (make-new-paste *pastes* (annotate - (paste-number annotate-this) - (paste-annotations annotate-this)) - url - :number number - :user paste-user - :title paste-title - :contents paste-contents - :universal-time (get-universal-time) - :channel paste-channel) - (format nil "Your paste has been announced to ~A and is available at ~A ." - paste-channel url)))))))) + (if (> (length paste-contents) + *paste-maximum-size*) + "Error: paste too large." + (let ((annotate-this (if annotate (find annotate *pastes* :key #'paste-number))) + (paste-contents (remove #\return paste-contents))) + (if (if annotate + (not (string-equal paste-channel (paste-channel annotate-this))) + (not (member paste-channel *channels* :test #'string-equal))) + (format nil "Error: invalid channel ~S." paste-channel) + (let* ((number (if annotate + (incf (paste-annotation-counter annotate-this)) + (incf *paste-counter*))) + (url (araneida:urlstring + (araneida:merge-url *display-paste-url* + (if annotate + (format nil "~A#~A" + (paste-number annotate-this) + number) + (prin1-to-string number)))))) + (make-new-paste *pastes* (annotate + (paste-number annotate-this) + (paste-annotations annotate-this)) + url + :number number + :user paste-user + :title paste-title + :contents paste-contents + :universal-time (get-universal-time) + :channel paste-channel) + (format nil "Your paste has been announced to ~A and is available at ~A ." + paste-channel url))))))))) ((string-equal method-name "pasteheaders") (destructuring-bind (length &optional supplied-start) args