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

Refactor candidate 2 #75

Merged
merged 107 commits into from May 1, 2018
Merged

Refactor candidate 2 #75

merged 107 commits into from May 1, 2018

Conversation

strictlymike
Copy link
Collaborator

Unified packet processing code for Windows and Linux

Copy link
Contributor

@tankbusta tankbusta left a comment

Choose a reason for hiding this comment

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

I was basically looking for things to comment on...

cfds = False if winders else True
shl = False if winders else True
cflags = DETACHED_PROCESS if self.running_on_windows else 0
cfds = False if self.running_on_windows else True
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't have to change this but apparently this is also possible (I didn't know until now)

cfds = not self.running_on_windows

def fmtCsumData(self, sep='/'):
if self._is_ip:
return '%s %s %s ' % (self.fmtL3Csums(), sep, self.fmtL4Csums())
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

This else can be removed

if proto_name and ip and port:
return self._linux_find_sock_by_endpoint_unsafe(ipver, proto_name,
ip, port, local)
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed

except WindowsError as e:
if e.winerror in [4,6,995]:
if e.winerror in [4, 6, 995]:
return
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed

@strictlymike
Copy link
Collaborator Author

Thanks for taking the time to look closely. In the interest of not further blocking progress on other tickets, I'm going to continue the merge, but I've added your comments to my file of code quality issues and am going to add a code quality project to my roadmap.

@strictlymike strictlymike merged commit e54c737 into master May 1, 2018
@strictlymike strictlymike deleted the refactor-candidate-2 branch August 21, 2018 16:38
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.

None yet

2 participants