Skip to content

max_packet_size is a parameter#2

Merged
scottchiefbaker merged 5 commits intoscottchiefbaker:mainfrom
sbonaime:main
Oct 2, 2024
Merged

max_packet_size is a parameter#2
scottchiefbaker merged 5 commits intoscottchiefbaker:mainfrom
sbonaime:main

Conversation

@sbonaime
Copy link
Copy Markdown
Contributor

No description provided.

@sbonaime sbonaime mentioned this pull request Sep 26, 2024
@sbonaime sbonaime changed the title max_buffer_size is a parameter max_packet_size is a parameter Sep 27, 2024
Comment thread SimpleSyslog.h Outdated
this->_server = server;
this->_port = port;
this->_max_buffer_size = max_buffer_size;
this->_max_packet_size = max_packet_size;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can we make sure the right side lines up the rest of the lines using spaces?

Comment thread SimpleSyslog.h Outdated
// This is a unit8 instead of a char because that's what udp.write() wants
uint8_t buffer[_max_buffer_size+OVERHEAD_PACKET_SIZE];
int len = snprintf((char*)buffer, _max_buffer_size+OVERHEAD_PACKET_SIZE, "<%d>%s %s: %s", priority, _hostname, _app, buf);
uint8_t buffer[_max_packet_size+OVERHEAD_PACKET_SIZE];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think we need to remove OVERHEAD_PACKET_SIZE here right?

@scottchiefbaker
Copy link
Copy Markdown
Owner

This looks good save for two little things I mentioned above in comments. If you fix those I'll land this.

@scottchiefbaker
Copy link
Copy Markdown
Owner

This looks good and compiles for me. I'm going to land it and then make some minor whitespace fixes.

@scottchiefbaker scottchiefbaker merged commit 2dbe4dd into scottchiefbaker:main Oct 2, 2024
@scottchiefbaker
Copy link
Copy Markdown
Owner

I also dropped the default packet size back to 128 so we're consistent with what we had before. I think 128 should be plenty for most use cases, and it saves a bit of RAM.

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.

2 participants