command/agent: block windows socket errors

This commit is contained in:
Mitchell Hashimoto 2014-05-15 11:29:32 -07:00
parent 78b7c57ba3
commit bae3c1606c
2 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,8 @@ BUG FIXES:
* Renaming "seperator" to "separator". This is the correct spelling,
but both spellings are respected for backwards compatibility. [GH-101]
* Private IP is properly found on Windows clients.
* Windows agents won't show "failed to decode" errors on every RPC
request.
## 0.2.0 (May 1, 2014)

View File

@ -295,8 +295,13 @@ func (i *AgentRPC) handleClient(client *rpcClient) {
for {
// Decode the header
if err := client.dec.Decode(&reqHeader); err != nil {
if err != io.EOF && !i.stop {
i.logger.Printf("[ERR] agent.rpc: failed to decode request header: %v", err)
if !i.stop {
// The second part of this if is to block socket
// errors from Windows which appear to happen every
// time there is an EOF.
if err != io.EOF && !strings.Contains(err.Error(), "WSARecv") {
i.logger.Printf("[ERR] agent.rpc: failed to decode request header: %v", err)
}
}
return
}