require header match
This commit is contained in:
@@ -69,6 +69,7 @@ func (m *TCPServerMux) handleFunction(connection net.Conn, messageType PoolMessa
|
||||
function, ok := m.functions[messageType]
|
||||
m.mu.RUnlock()
|
||||
if ok {
|
||||
connection.Write(header[:])
|
||||
responseType, responseData, err := function(data)
|
||||
if err != nil {
|
||||
errData := []byte(err.Error())
|
||||
@@ -93,6 +94,8 @@ func (m *TCPServerMux) handleFunction(connection net.Conn, messageType PoolMessa
|
||||
packetsSent.Inc()
|
||||
_, err = connection.Write(responseData)
|
||||
return true, err
|
||||
} else {
|
||||
log.Printf("No pool handler for type: %d\n", messageType)
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user