Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cameron-dunn-sublime
Copy link
Contributor

@cameron-dunn-sublime cameron-dunn-sublime commented Apr 10, 2023

Describe the change
This allows, but does not require, a client to use GZIP compression when calling Strelka.

Originally implemented in sublime-security#26

Describe testing procedures

	opts := []grpc.CallOption{grpc.WaitForReady(true), grpc.UseCompressor(grpcgzip.Name)}
	scanFile, err := sc.frontend.ScanFile(ctx, opts...)

I modified a client to include the grpc.UseCompressor(grpcgzip.Name) option and validated that grpc: Decompressor is not installed for grpc-encoding "gzip" is returned without this change. Everything works as normal when this change is included. I also tested without the option to ensure backwards compatibility.

Sample output
No changes.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of and tested my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@cameron-dunn-sublime cameron-dunn-sublime marked this pull request as ready for review April 10, 2023 23:37
@phutelmyer phutelmyer added the enhancement New feature or request label Apr 17, 2023
@phutelmyer
Copy link
Contributor

While this is just an import, I'm curious if we want to add the UseCompressor line in as a build option (off by default)? Either way this looks good to merge - shouldn't cause any issues.

@cameron-dunn-sublime
Copy link
Contributor Author

👍 we definitely could. I'm not sure if many consumers are using fileshot/filestream/oneshot as their production client, but if so then it would make sense.

If we do want to make that change, it'll be easier with the changes to rework go.mod so that structs can be updated.

@phutelmyer phutelmyer merged commit 7d35ae4 into target:master Apr 19, 2023
@cameron-dunn-sublime cameron-dunn-sublime deleted the cd.target.gzip branch April 19, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants