Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Provide better implementation for FileStream::id() #2705

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jan 10, 2024

This PR provides a better ID string for file streams.

How ETAGs are generated is not specified. Previous implementation was like this:

m_snprintf(buf, ETAG_SIZE, _F("00f-%x-%x0-%x"), stat.id, stat.size, stat.name.length);

Issues are:

  • on some architectures compiler warns about differing types %x vs arguments
  • name can change without length being affected; if name changes then file lookup would fail anyway
  • modification timestamp is a good metric, should be incorporated

@SmingHub SmingHub deleted a comment from what-the-diff bot Jan 10, 2024
@slaff slaff added this to the 5.2.0 milestone Jan 11, 2024
@slaff slaff merged commit eba0793 into SmingHub:develop Jan 11, 2024
46 checks passed
@mikee47 mikee47 deleted the fix/filestream-id branch January 11, 2024 08:41
@slaff slaff mentioned this pull request Feb 5, 2024
5 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants