+ case 'D': /* DELETED */
+ return MEMCACHED_DELETED;
+ case 'N': /* NOT_FOUND */
+ {
+ if (buffer[4] == 'F')
+ return MEMCACHED_NOTFOUND;
+ else if (buffer[4] == 'S')
+ return MEMCACHED_NOTSTORED;
+ else
+ {
+ memcached_io_reset(ptr);
+ return MEMCACHED_UNKNOWN_READ_FAILURE;
+ }
+ }
+ case 'E': /* PROTOCOL ERROR or END */
+ {
+ if (buffer[1] == 'N')
+ return MEMCACHED_END;
+ else if (buffer[1] == 'R')
+ {
+ memcached_io_reset(ptr);
+ return MEMCACHED_PROTOCOL_ERROR;
+ }
+ else
+ {
+ memcached_io_reset(ptr);
+ return MEMCACHED_UNKNOWN_READ_FAILURE;
+ }
+ }
+ case 'C': /* CLIENT ERROR */
+ memcached_io_reset(ptr);
+ return MEMCACHED_CLIENT_ERROR;
+ default:
+ memcached_io_reset(ptr);
+ return MEMCACHED_UNKNOWN_READ_FAILURE;
+
+ }