cleaning up logging a smidge
This commit is contained in:
parent
81906f08f6
commit
1dd4a113a6
|
@ -50,7 +50,7 @@ func (odClient *ODClient) Connect(privateKeyData string, serverAddr string) erro
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Println("ODCleint connected!")
|
log.Println("ODCleint connected!")
|
||||||
log.Println("starting auth...")
|
log.Println("Starting auth...")
|
||||||
known, err := connection.HandleOutboundConnection(odClient.connection).ProcessAuthAsClient(privateKey)
|
known, err := connection.HandleOutboundConnection(odClient.connection).ProcessAuthAsClient(privateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error handling auth: %v", err)
|
log.Println("Error handling auth: %v", err)
|
||||||
|
@ -58,13 +58,12 @@ func (odClient *ODClient) Connect(privateKeyData string, serverAddr string) erro
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("go Process")
|
log.Println("go Process")
|
||||||
// TODO: end with breakChannel
|
|
||||||
go odClient.connection.Process(odClient)
|
go odClient.connection.Process(odClient)
|
||||||
|
|
||||||
if !known {
|
if !known {
|
||||||
err := odClient.connection.RequestOpenChannel("im.ricochet.contact.request", odClient)
|
err := odClient.connection.RequestOpenChannel("im.ricochet.contact.request", odClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("could not contact %s", err)
|
log.Printf("Could not auth with server", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +75,7 @@ func (odClient *ODClient) Connect(privateKeyData string, serverAddr string) erro
|
||||||
log.Println("Error: " + err.Error())
|
log.Println("Error: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
//log.Println("sending greeting message")
|
log.Println("Connection fully initiated, chat channel open!")
|
||||||
//odClient.SendMessage("hello from the client")
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +125,7 @@ func (odClient *ODClient) GetMessage() string {
|
||||||
|
|
||||||
// ChatMessage passes the response to recvMessages.
|
// ChatMessage passes the response to recvMessages.
|
||||||
func (odc *ODClient) ChatMessage(messageID uint32, when time.Time, message string) bool {
|
func (odc *ODClient) ChatMessage(messageID uint32, when time.Time, message string) bool {
|
||||||
log.Printf("Received Message: %s", message)
|
//log.Printf("Received Message: %s", message)
|
||||||
odc.recvMessages <- message
|
odc.recvMessages <- message
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ func GetOnionAddress(privateKey string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ODClientConnect(privateKey string, serverAddr string) error {
|
func ODClientConnect(privateKey string, serverAddr string) error {
|
||||||
log.Println("ODClientConnect(" + serverAddr + ")")
|
log.Println("ODClientConnect()")
|
||||||
odClient = new(ODClient.ODClient)
|
odClient = new(ODClient.ODClient)
|
||||||
err := odClient.Connect(privateKey, serverAddr)
|
err := odClient.Connect(privateKey, serverAddr)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue