Skip to content

Conversation

@notmike-5
Copy link

This commit modifies the MAX_OTR_MSG_SIZE macro to reflect the 512-byte limit imposed by the IRC standard RFC 2812, adds header guards, and cleans up/updates some file commentary.

kg_pipe Key generation for %s: error creating pipe: %s
kg_fork Key generation for %s: fork() error: %s
kg_mkdir created directory %s
kg_pipe Key generation for %s: error creating pipe: %s
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd whitespace changes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it just wasn't lining up right on my editor.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect @TingPing would prefer white space changes to be in a separate pull request, and not mixed with functional changes.

/* Most IRC servers limit messages to 512 bytes in length,
* including trailing whitespace and the CR-LF terminating characters
* i.e len( bytes(msg) | <0x20> x ... | <0x0D0A> ) <= 512 bytes */
#define OTR_MAX_MSG_SIZE 510 //RFC 2812
Copy link
Owner

@TingPing TingPing Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not certain this makes sense. The message size often needs to account for the user!user@hostname PRIVMSG dest ... bits at the start. I think hexchat internally accounts that for like 90ish characters by default (before it knows this information). You can kinda figure it out exactly if you know the information ahead of time.

Copy link
Author

@notmike-5 notmike-5 Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not totally sure myself. I relied on this and RFC2812 in coming up with that number. IRC seems to have a limit of 512, but hexchat could certainly further reduce this.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RFC is referring to the entire line. But generally at the layer of users like this message just means the content.

So an IRC line is 512 bytes but with protocol overhead user messages can only realistically use 400-500 depending on the users full host.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I can confirm. I just tried sending a line of 561 chars (including spaces) on Libera.chat, and hexchat split it off at 446 chars.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you open Window > Raw Log you can see why it had to be split with the prefixes.

@TingPing
Copy link
Owner

Try to keep logic changes and formatting changes in different commits/PRs.

@notmike-5
Copy link
Author

Will do. My apologies. I'm still very new to this and not very familiar with the correct etiquette for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants