Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add support for Echo requests #25

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Add support for Echo requests #25

merged 2 commits into from
Jan 22, 2025

Conversation

jgiannuzzi
Copy link
Contributor

This PR adds support for Echo requests/responses, which can be used as an application layer keepalive.

@jgiannuzzi
Copy link
Contributor Author

Hi @arashpayan, could you please review this PR?

For context, I'm working on improving the rclone smb backend. One of the things I'd like to do is using Echo as a way to reduce the overhead when testing that connections are still working.

@arashpayan
Copy link
Collaborator

Thanks for the PR @jgiannuzzi. Looks good and it works against my Samba instance. I just have one request. Could you add a test to the smb2_test.go file? Something like:

func TestEcho(t *testing.T) {
	if session == nil {
		t.Skip()
	}

	err := session.Echo()
	require.NoError(t, err)
}

As a bonus, when you save smb2_test.go, your formatter will probably update all the octal values to the new format.

@arashpayan
Copy link
Collaborator

To clarify, I'm fine with the updated octal format.

@jgiannuzzi
Copy link
Contributor Author

jgiannuzzi commented Jan 22, 2025

Good point about the tests – I didn't realise how they were setup! That's now added.
My formatter is gofumpt but it's not configured with the -extra flag because this is not yet supported within gopls (see mvdan/gofumpt#251) – the result is that it didn't change the octal values!

@arashpayan arashpayan merged commit 4fc3b7e into CloudSoda:main Jan 22, 2025
2 checks passed
@arashpayan
Copy link
Collaborator

Thanks again for the contribution @jgiannuzzi.

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