-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add *MAX-LINE-LENGTH* and *MAX-HEADER-LINE-LENGTH* #9
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to what I've noted in specific comment, *max-line-length*
and *max-header-line-length*
should be added to the :export
list in [packages.lisp], and some text should be added to [docs/index.html].
@@ -100,8 +100,11 @@ Additionally logs this string to LOG-STREAM if it is not NIL." | |||
(let ((result | |||
(with-output-to-string (line) | |||
(loop for char-seen-p = nil then t | |||
for count from 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wacky indentation
for char = (read-char* stream nil) | ||
for is-cr-p = (and char (char= char #\Return)) | ||
when (and *max-line-length* (> count *max-line-length*)) | ||
do (error 'input-exceeded-limit :maximum *max-line-length*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, wacky indentation
@@ -78,6 +78,13 @@ variable has a true value, though.") | |||
"A `buffer' for one character. Used by PEEK-CHAR* and | |||
UNREAD-CHAR*.") | |||
|
|||
(defvar *max-line-length* nil | |||
"Maximum length of a line. If NIL, lines may be any length.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd appreciate more documentation. The docstring should address:
- what happens when attempting to read an overlong line.
- appropriate types and values this variable may take
@@ -78,6 +78,13 @@ variable has a true value, though.") | |||
"A `buffer' for one character. Used by PEEK-CHAR* and | |||
UNREAD-CHAR*.") | |||
|
|||
(defvar *max-line-length* nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add declaim
of type
for this and the other special var. I assume the correct type is (or null unsigned-byte)
, but it may be (or null (and fixnum unsigned-byte))
or something.
Addresses #8.
This adds two special variables and an error condition.