Fixes a few logical issues and order of op

This commit is contained in:
sloumdrone 2019-09-27 19:19:23 -07:00
parent bef32b7ff5
commit 6c52299c7a
2 changed files with 2 additions and 2 deletions

View File

@ -833,12 +833,12 @@ func (c *client) Visit(url string) {
} }
case "gemini": case "gemini":
capsule, err := gemini.Visit(u.Host, u.Port, u.Resource, &c.Certs) capsule, err := gemini.Visit(u.Host, u.Port, u.Resource, &c.Certs)
go saveConfig()
if err != nil { if err != nil {
c.SetMessage(err.Error(), true) c.SetMessage(err.Error(), true)
c.DrawMessage() c.DrawMessage()
return return
} }
go saveConfig()
switch capsule.Status { switch capsule.Status {
case 1: case 1:
c.search("", u.Full, capsule.Content) c.search("", u.Full, capsule.Content)

View File

@ -113,7 +113,7 @@ func Retrieve(host, port, resource string, td *TofuDigest) (string, error) {
// the hostname on the certificate(s) from the server // the hostname on the certificate(s) from the server
// is the hostname we have requested // is the hostname we have requested
connState := conn.ConnectionState() connState := conn.ConnectionState()
if len(connState.PeerCertificates) < 0 { if len(connState.PeerCertificates) < 1 {
return "", fmt.Errorf("Insecure, no certificates offered by server") return "", fmt.Errorf("Insecure, no certificates offered by server")
} }
hostCertExists := td.Exists(host) hostCertExists := td.Exists(host)