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

timeouts by config and pop3 locking #4

Merged
merged 7 commits into from
Jun 1, 2016
Merged

timeouts by config and pop3 locking #4

merged 7 commits into from
Jun 1, 2016

Conversation

shppr
Copy link
Collaborator

@shppr shppr commented Jun 1, 2016

Timeouts:
Timeouts are in seconds in the config. This is the least coupled way I could think of to do this, anything else would require something like a timeout field in the server struct and then making the accept function a member of server as well.

Locks:

Lock on auth, unlock when client state is disconnected or on timeout if client was authed.

@shppr shppr changed the title use config for timeouts, only timeout non outbound smtp server timeouts by config and pop3 locking Jun 1, 2016
@@ -28,6 +31,12 @@ func (s *Server) Start() {
if err != nil {
panic(err.Error())
}

// set a timeout for the inbound server
Copy link
Owner

Choose a reason for hiding this comment

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

This is not needed. It should be set through Server{} initialization in main.go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is debatable, accept() doesnt know anything about the server, which is where the timeout should live. the only solution if the timeout is in the server struct is to make accept() part of Server{}'s method set

@trapped trapped merged commit 281638c into master Jun 1, 2016
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.

3 participants