Check protocol version and auth token (hard coded for now)
This commit is contained in:
12
server.go
12
server.go
@@ -97,11 +97,23 @@ func handleConnection(conn *net.TCPConn) {
|
||||
log.Printf("connection has been closed prematurely")
|
||||
return
|
||||
}
|
||||
|
||||
// xxx we need to add a response part here so they can be notified
|
||||
if err != nil {
|
||||
log.Printf("error while expecting PacketStart: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
if start.ProtocolVersion != "1.0" {
|
||||
log.Printf("bad protocol version")
|
||||
return
|
||||
}
|
||||
|
||||
if start.AuthToken != "dummy" {
|
||||
log.Print("bad authtoken")
|
||||
return
|
||||
}
|
||||
|
||||
conn.SetDeadline(time.Now().Add(time.Second * 5))
|
||||
|
||||
if start.OperationType == secure.OperationTypeSend {
|
||||
|
||||
Reference in New Issue
Block a user