Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5 from jgrahamc/master

Fixed a bug where a bad connection gets reused
  • Loading branch information...
commit 66c15b06fea42e943de7cc69c83eb119858567bd 2 parents 8f3468c + b198fc8
@bradfitz authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 memcache/memcache.go
View
4 memcache/memcache.go
@@ -183,6 +183,8 @@ func (cn *conn) extendDeadline() {
func (cn *conn) condRelease(err *error) {
if *err == nil || resumableError(*err) {
cn.release()
+ } else {
+ cn.nc.Close()
}
}
@@ -289,7 +291,7 @@ func (c *Client) onItem(item *Item, fn func(*Client, *bufio.ReadWriter, *Item) e
return err
}
defer cn.condRelease(&err)
- if err := fn(c, cn.rw, item); err != nil {
+ if err = fn(c, cn.rw, item); err != nil {
return err
}
return nil
Please sign in to comment.
Something went wrong with that request. Please try again.