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

Draft: Added a buffered reader for dtx connections #435

Closed
wants to merge 1 commit into from

Conversation

diegoperini
Copy link
Collaborator

No description provided.

@diegoperini diegoperini changed the title Added a buffered reader for dtx connections Draft: Added a buffered reader for dtx connections Jul 19, 2024
@@ -31,11 +34,12 @@ type DeviceConnectionInterface interface {
type DeviceConnection struct {
c net.Conn
unencryptedConn net.Conn
bufferedReader io.Reader
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think that's the right place to add a buffered reader. We have two connections to the device already in this struct. If we add buffering now to one of them, the buffer may hold more data than expected and switching between those sessions could break (I think this is mainly happening on older iOS versions)

If you want to add buffering to the DTX connection as the title says, it would be safer to do so in the DTX connection itself as nothing about the connection would change at that point anymore.

Copy link
Collaborator Author

@diegoperini diegoperini Jul 22, 2024

Choose a reason for hiding this comment

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

I think I understand.

That would mean I may have to define a new type that implements net.Conn, wraps a real net.Conn and uses a buffered reader internally for the Read() operations. The rest of the operations would be delegated to the wrapped, original net.Conn instance.

MOSTY IMPORTANTLY, this should happen BEFORE we construct a DeviceConnection object.

Correct?

@diegoperini
Copy link
Collaborator Author

Closing this one. Alternative solution here: https://github.com/danielpaulus/go-ios/pull/438/files

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