count single \r or \n as \r\n while checking line length against MAXHEADERSIZE
Julien ÉLIE
julien at trigofacile.com
Sun Oct 24 16:09:17 UTC 2010
Hi all,
>> Perhaps we should in fact abolish the check or
>> test against a larger size (BIG_BUFFER?) if we don't want to accept
>> anything?
>
> I will have to see where the headers are used elsewhere in the code.
> I do not know whether innd copes with an arbitrary length for a header
> line. (Well, I believe it does because a field can be wrapped on an
> arbitrary number of lines.) We just have to be sure that it works well
> at the time of treating the initial buffer containing the message.
Just tested and innd copes up very well with a header line (and also a body
line) of about 46k characters.
It properly appears in response to ARTICLE and OVER.
I believe it is safe to drop the check on line length, as suggested by
Florian.
In case someone is interested in testing a news server with the Python
socket module, here is a basic script.
Works both in Python 2 and Python 3:
import socket
HOTE = 'news.trigofacile.com'
PORT = 119
LONGUEUR_REPONSE = 1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOTE, PORT))
data = s.recv(LONGUEUR_REPONSE)
print (repr(data))
s.send(b'DATE\r\n')
data = s.recv(LONGUEUR_REPONSE)
print (repr(data))
s.send(b'IHAVE <abc at test>\r\n')
data = s.recv(LONGUEUR_REPONSE)
print (repr(data))
s.send(b'''Subject:test\r\n...\r\n\r\nbody\r\n.\r\n''')
data = s.recv(LONGUEUR_REPONSE)
print (repr(data))
s.send(b'QUIT\r\n')
data = s.recv(LONGUEUR_REPONSE)
print (repr(data))
s.close()
Have a nice week,
--
Julien ÉLIE
« Dans l'algèbre comme dans la police, il faut identifier X. » (André Frédérique)
More information about the inn-workers
mailing list