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

Prevent hanging on TCP connections that won't return [any/full] OPC UA data #628

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jb0n
Copy link

@jb0n jb0n commented Jan 15, 2023

Great lib! I was using it to look at some interesting OPC UA servers I found on the internet (scanning for them truth be told) and ran into situations where io.ReadFull hangs forever. I made some changes and allowed the Dialer to have a read timeout it can pass to connections.

@jb0n jb0n changed the title Prevent hanging on TCP connections that won't return [faull] OPC UA data Prevent hanging on TCP connections that won't return [any/full] OPC UA data Jan 17, 2023
Copy link
Member

@magiconair magiconair 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. Can you just use a time.Duration and check if it is greater than zero instead of using a pointer?

Also, can you squash your commits please?

Then I'll merge it.

@magiconair magiconair added this to the v0.3.13 milestone Mar 22, 2023
jgould and others added 2 commits March 23, 2023 12:05
@magiconair magiconair modified the milestones: v0.3.13, v0.4 Mar 23, 2023
@magiconair
Copy link
Member

I've rebased your changes onto main, squashed them and also added support for write timeouts. I've also cleared the deadline after the read/write. Not sure if this is necessary. Could you please review and test this change?

@kung-foo it would be great if you could have a look at this as well.

I've tagged this for v0.4 since this may have some wider implications.

@magiconair magiconair dismissed their stale review March 23, 2023 11:14

I've reworked the change myself

@jb0n
Copy link
Author

jb0n commented Mar 24, 2023 via email

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