ergochat / ergo

A modern IRC server (daemon/ircd) written in Go.
https://ergo.chat/
MIT License
2.23k stars 178 forks source link

Input line too long #2075

Closed kingter-sutjiadi closed 1 year ago

kingter-sutjiadi commented 1 year ago

Hi one of my client got this error from server when chat like this

<IRCMsg: from=beta-ergo.idn.media <IRCCmd: 417 args=timotius-leonardo,Input line too long>>

the client is iOS using swift-nio pod

what configuration do i need to change to be able to send the message

slingamn commented 1 year ago

Try setting server.compatibility.allow-truncation to true, then rehashing or restarting.

slingamn commented 1 year ago

What client is this exactly? The OS and the I/O framework aren't necessarily relevant, the issue is that the client is sending lines that violate the IRC protocol by being longer than 512 total bytes (not including tags). See here: https://modern.ircdocs.horse/#message-format

kingter-sutjiadi commented 1 year ago

hi thank you for the responses, sry for the late reply, which config to increase the server limit to fulfill "servers must allow 4096 additional bytes."

slingamn commented 1 year ago

Ergo already allows 4096 bytes of tag data. The body section and the tags section are counted separately, and the body section is limited to 512 bytes.

There is an Ergo configuration option to increase the body length limit (server.max-line-len) but it is very dangerous to change this value, since it breaks compatibility with mainstream clients. (The problem is this: a PRIVMSG sent from a modern client may ultimately need to be relayed to an older client that assumes a 512-byte limit on the total message size. Tags are not a problem here because such an older client does not support tags, so the tags section is dropped in its entirety.)

kingter-sutjiadi commented 1 year ago

thank you i'll close the issue @slingamn 🙏