Skip to content

Conversation

@intrigus-lgtm
Copy link
Contributor

No description provided.

`location` would otherwise be passed as NULL to fd_memcpy.
tar.zstfoobar was previously accepted, but shouldn't.
@intrigus-lgtm intrigus-lgtm force-pushed the intrigus/fix/ss-http-resolve-archive-misc branch from 9648996 to 8997d39 Compare December 3, 2025 15:56
Copy link
Contributor

@ripatel-fd ripatel-fd left a comment

Choose a reason for hiding this comment

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

Thank you very much for the fixes, these look great. Would you mind adding unit tests reproducing the bugs you've fixed though? If you don't have time to do this, I'm happy to take it over. Just blocking for now to keep myself honest because if I merge this, I'll just forget to add tests later.

@amass-jump amass-jump self-requested a review December 3, 2025 15:59
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.062978 s 0.063589 s 0.970%
backtest mainnet-368528500-perf snapshot load 2.352 s 2.298 s -2.296%
backtest mainnet-368528500-perf total elapsed 62.978149 s 63.589483 s 0.971%
firedancer mem usage with mainnet.toml 1014.23 GiB 1014.23 GiB 0.000%

}
}

if( FD_UNLIKELY( !location ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if( FD_UNLIKELY( !location ) ) {
if( FD_UNLIKELY( !location_len ) ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a specific reason you prefer this?
When location is not NULL, location_len >= 1 should be guaranteed by line 264.
But of course happy to change this.

Copy link
Contributor

Choose a reason for hiding this comment

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

We typically always do "slice empty?" type checks on the length field. It's a more complete solution because often slices with an invalid (but not NULL) base pointer and a zero size length are considered valid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense!
Should I align

if( FD_UNLIKELY( !location ) ) {
FD_LOG_WARNING(( "no location header in redirect response" ));
fd_sshttp_cancel( http );
return FD_SSHTTP_ADVANCE_ERROR;
}
to this pattern as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes please

@intrigus-lgtm
Copy link
Contributor Author

Thank you very much for the fixes, these look great. Would you mind adding unit tests reproducing the bugs you've fixed though? If you don't have time to do this, I'm happy to take it over. Just blocking for now to keep myself honest because if I merge this, I'll just forget to add tests later.

A few of those functions are in static functions.
How should I test those?
I could either make them non-static or test them indirectly.

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