Skip to content

Incorrect fallthrough in memcached_behavior_set for REMOVE_FAILED_SERVERS #35

@m6w6

Description

@m6w6

Imported from Launchpad using lp2gh.


memcached_behavior_set contains the following two cases, the first falls through into the second:

  case MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS:
    ptr->flags.auto_eject_hosts= bool(data);

  case MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT:
    if (data == 0)
    {
      return memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
                                        memcached_literal_param("MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT requires a value greater then zero."));
    }
    ptr->server_failure_limit= uint32_t(data);
    break;

Having zero data for the first is perfectly valid (it means "don't remove failed servers,"), when when we fall through, it causes an error. There should be a "break" at the end of that first case block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions