Skip to content

Commit e2d9da6

Browse files
committed
Add comments
Signed-off-by: Muhammad Raisul Islam Evan <raisul@appscode.com>
1 parent 1842075 commit e2d9da6

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

memcache/memcache.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var (
117117
resultClientErrorPrefix = []byte("CLIENT_ERROR ")
118118
versionPrefix = []byte("VERSION")
119119

120-
// Auth-file Related Error
120+
// Authentication Related Error
121121
resultUnauthenticatedError = []byte("CLIENT_ERROR unauthenticated\r\n")
122122
resultAuthenticationFailure = []byte("CLIENT_ERROR authentication failure\r\n")
123123
resultBadCommandFormat = []byte("CLIENT_ERROR bad command line format\r\n")
@@ -191,10 +191,10 @@ type Item struct {
191191
// required for a CompareAndSwap request to succeed.
192192
CasID uint64
193193

194-
// Username for Auth-file
194+
// Username for Authentication
195195
User string
196196

197-
// Password for Auth-file
197+
// Password for Authentication
198198
Pass string
199199
}
200200

@@ -640,7 +640,6 @@ func (c *Client) cas(rw *bufio.ReadWriter, item *Item) error {
640640
}
641641

642642
func (c *Client) populateOne(rw *bufio.ReadWriter, verb string, item *Item) error {
643-
klog.Infoln("Started PopulateOne... %v", verb)
644643
if !legalKey(item.Key) {
645644
return ErrMalformedKey
646645
}
@@ -649,8 +648,6 @@ func (c *Client) populateOne(rw *bufio.ReadWriter, verb string, item *Item) erro
649648
_, err = fmt.Fprintf(rw, "%s %s %d %d %d %d\r\n",
650649
verb, item.Key, item.Flags, item.Expiration, len(item.Value), item.CasID)
651650
} else {
652-
klog.Infoln(rw)
653-
klog.Infoln(verb, item.Key, item.Flags, item.Expiration, len(item.Value))
654651

655652
_, err = fmt.Fprintf(rw, "%s %s %d %d %d\r\n",
656653
verb, item.Key, item.Flags, item.Expiration, len(item.Value))
@@ -672,8 +669,6 @@ func (c *Client) populateOne(rw *bufio.ReadWriter, verb string, item *Item) erro
672669
return err
673670
}
674671

675-
klog.Infoln(string(line))
676-
677672
switch {
678673
case bytes.Equal(line, resultStored):
679674
return nil
@@ -803,7 +798,7 @@ func (c *Client) Close() error {
803798
return ret
804799
}
805800

806-
// ------------------------------------------------------------------------------------------
801+
// Memcached Authentication
807802

808803
func (c *Client) SetAuth(item *Item) error {
809804
return c.onItem(item, (*Client).setAuth)
@@ -819,8 +814,6 @@ func (c *Client) authFunc(rw *bufio.ReadWriter, verb string, item *Item) error {
819814
}
820815
var err error
821816
if verb == "set" {
822-
klog.Infoln("Auth Started & Get the Set Command")
823-
klog.Infoln(rw)
824817
klog.Infoln(verb, item.Key, item.Flags, item.Expiration, len(item.User)+len(item.Pass)+1, item.User, item.Pass)
825818

826819
_, err = fmt.Fprintf(rw, "%s %s %d %d %d\r\n%s %s\r\n",
@@ -833,10 +826,6 @@ func (c *Client) authFunc(rw *bufio.ReadWriter, verb string, item *Item) error {
833826
klog.Errorf(err.Error())
834827
return err
835828
}
836-
/*if _, err := rw.Write(crlf); err != nil {
837-
klog.Errorf(err.Error())
838-
return err
839-
}*/
840829
if err := rw.Flush(); err != nil {
841830
klog.Errorf(err.Error())
842831
return err

0 commit comments

Comments
 (0)