Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-773

Malformed memcached cas command should result in CLIENT_ERROR

XMLWordPrintable

      From Michal:

      [mlinhard@michal-linhard ~]$ echo -e "cas bad blah 0 0 0\r\n\r\n" | nc localhost 11211
      SERVER_ERROR org.infinispan.server.core.ServerException: java.lang.NumberFormatException: For input string: "blah"
      [mlinhard@michal-linhard ~]$ echo -e "cas bad 0 blah 0 0\r\n\r\n" | nc localhost 11211
      SERVER_ERROR org.infinispan.server.core.ServerException: java.lang.NumberFormatException: For input string: "blah"
      [mlinhard@michal-linhard ~]$ echo -e "cas bad 0 0 blah 0\r\n\r\n" | nc localhost 11211
      SERVER_ERROR org.infinispan.server.core.ServerException: java.lang.NumberFormatException: For input string: "blah"
      [mlinhard@michal-linhard ~]$ echo -e "cas bad 0 0 0 blah\r\n\r\n" | nc localhost 11211
      SERVER_ERROR org.infinispan.server.core.ServerException: java.lang.NumberFormatException: For input string: "blah"

      in each case memcached server module should have replied with "CLIENT_ERROR <error>\r\n"
      as required in: https://github.com/memcached/memcached/blob/master/doc/protocol.txt

      FYI: original memcached server implementation replies "CLIENT_ERROR bad command line format\r\n" (which is also expected by their test suite, but not required by protocol)

      Also, verify what Memcached server does with "cas foo 0 0 6 \r\nbarva2\r\n" as opposed to Infinispan Memcached.

              rh-ee-galder Galder ZamarreƱo
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: