It will either return the full string if its length was
maxlen or less, or up to maxlen characters with
a "..." appended at the end. It will also replace any
\n or \r character with a literal "\n" or "\r"
respectively. Only line breaks are being replaced, and
this happens inside truncated_string() because truncating
only makes sense to me if you want to use it to
keep stuff short and in one single line.
As part of the partial improvement to the POST reading
code I also added a max_post_size setting which defaults
to 1 MiB. POST inputs longer than that size get truncated.
This is separate to max_pastie_size, which is just the
size of one of the values in the POST data.
Something like the old m_param string is still needed
because Location responses need to send an URL.
The type of the response now determines if m_mime
or m_redirect_location is used.
It expands to the host_path setting in the ini file, with
the last slash removed if present. Use it to make absolute
links like {{host_path}}/tawashi.css.
The token rule was matching even when the quoted_string
rule should have matched, which was preventing the "
stripping to work. In fact quoted_string was never being
used.
Also improve formatting of long lines.
New code tries to guess a per-visitor IP address and uses
that (or its hash) to tell users apart.
This patch also adds a TAWASHI_WITH_IP_LOGGING cmake option
to enable or disable logging the IP address of your visitors
in various places (just one right now but don't assume things
to remain this way).
Also added a couple new CGI environment variables.