8000 ifs to switch by mellowdrifter · Pull Request #32 · bgp/stayrtr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ifs to switch #32

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

Merged
merged 1 commit into from
Oct 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,14 @@ func (c *ClientSession) StartSSH(addr string, config *ssh.ClientConfig) error {
}

func (c *ClientSession) Start(addr string, connType int, configTLS *tls.Config, configSSH *ssh.ClientConfig) error {

if connType == TYPE_TLS {
switch connType {
case TYPE_TLS:
return c.StartTLS(addr, configTLS)
} else if connType == TYPE_PLAIN {
case TYPE_PLAIN:
return c.StartPlain(addr)
} else if connType == TYPE_SSH {
case TYPE_SSH:
return c.StartSSH(addr, configSSH)
} else {
default:
return errors.New(fmt.Sprintf("Unknown type %v", connType))
}

}
0