fixed bug issue of #1213
fixed initServer failed if no IPV4 or no IPV6
fixed initServer fail while having no IPv6 nor IPv4
Merge pull request #1214 from kaoshijuan/unstable

fixed initServer fail problem
Fix for issue #1214 simplified.
Use a safe dict.c iterator in clusterCron().
Cluster: process MEET packets as PING packets.

Somewhat a previous commit broken this so CLUSTER MEET was no longer
working.
Cluster: fix CLUSTER MEET ip address validation.

This was broken by the IPv6 support patches.
Print error message when can't bind * on any address.
Opening TCP listening ports refactored into a function.
Use listenToPort() in cluster.c as well.
Cluster: set event handler in cluster bus listening socket.

The commit using listenToPort() introduced this bug by no longer
creating the event handler to handle incoming messages from the cluster
bus.
Don't update node pong time via gossip.

This feature was implemented in the initial days of the Redis Cluster
implementaiton but is not a good idea at all.

1) It depends on clocks to be synchronized, that is already very bad.
2) Moreover it adds a bug where the pong time is updated via gossip so
no new PING is ever sent by the current node, with the effect of no PONG
received, no update of tables, no clearing of PFAIL flag.

In general to trust other nodes about the reachability of other nodes is
a broken distributed programming model.
Only run the fast active expire cycle if master & enabled.
Update server.lastbgsave_status when fork() fails.
DEBUG SDSLEN added.

This command is only useful for low-level debugging of memory issues due
to sds wasting memory as empty buffer at the end of the string.
Don't over-allocate the sds string for large bulk requests.

The call to sdsMakeRoomFor() did not accounted for the amount of data
already present in the query buffer, resulting into over-allocation.
tryObjectEncoding(): don't call stringl2() for too big strings.

We are sure that a string that is longer than 21 chars cannot be
represented by a 64 bit signed integer, as -(2^64) is 21 chars:

strlen(-18446744073709551616) => 21
tryObjectEncoding(): optimize sds strings if possible.

When no encoding is possible, at least try to reallocate the sds string
with one that does not waste memory (with free space at the end of the
buffer) when the string is large enough.
Remove useful check from tryObjectEncoding().

We are sure the string is large, since when the sds optimization branch
is entered it means that it was not possible to encode it as EMBSTR for
size concerns.