You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/04/26 18:47:19 UTC
[GitHub] [mynewt-core] rymanluk commented on a change in pull request #1782:
sys/log: Add setting for maximum log entry size when writing.
rymanluk commented on a change in pull request #1782: sys/log: Add setting for maximum log entry size when writing.
URL: https://github.com/apache/mynewt-core/pull/1782#discussion_r279064379
##########
File path: sys/log/full/src/log.c
##########
@@ -569,6 +599,21 @@ log_append_mbuf_typed_no_free(struct log *log, uint8_t module, uint8_t level,
goto err;
}
+ /*
+ * Check that the log body length is less than the maximum entry. This code
+ * may appear a bit odd in that it checks that the length is greater than
+ * a log entry header length. The reason for this check is to ensure any
+ * error handling of this case to be the same as it was before the
+ * maximum entry length was checked.
+ */
+ len = os_mbuf_len(om);
+ if (len > LOG_ENTRY_HDR_SIZE) {
+ rc = log_chk_max_entry_len(log, len - LOG_ENTRY_HDR_SIZE);
+ if (rc) {
Review comment:
nitpick: once `if (rc )` is used, other time ` if(rc != OS_OK)` ;)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services