solderpunk/VF-1

Period

Closed this issue · 3 comments

What are your thoughts on the period? Do we unquote leading periods? Do we strip the trailing period? I know I spent a few lines of code on my server implementation to get the stupid period right, but I can't help but think that this is useless and we should ignore the RFC in this respect. The only benefit to having that period rule in the RFC would be if the client didn't hang up and sent another selector. Then clients would only have to close the connection after getting a binary file, right? But we don't do that, either.
Anyway, for now, I'm noticing that visiting alexschroeder.ch prints a final period for every text file and menu.

Also from the spec:

Lines beginning with periods must be prepended with an extra
period to ensure that the transmission is not terminated early.
The client should strip extra periods at the beginning of the line.

crcx commented

TextFile Transaction (Type 0 item)

C: Opens Connection.
S: Accepts connection
C: Sends Selector String.
S: Sends TextFile Entity.

Connection is closed by either client or server (typically server).

Note: The client should be prepared for the server closing the
connection without sending the Lastline. This allows the
client to use fingerd servers.

This indicates that the trailing '.' line isn't strictly necessary for text documents. (My server doesn't send it for anything other than directories).

The discussion on #gopherproject also indicated that current software ignores all of this.