1. 08 7月, 2013 23 次提交
    • G
      Mark places that might want changing for IPv6. · ca78446c
      Geoff Garside 提交于
      Any places which I feel might want to be updated to work differently
      with IPv6 have been marked with a comment starting "IPV6:".
      
      Currently the only comments address places where an IP address is
      combined with a port using the standard : separated form. These may want
      to be changed when printing IPv6 addresses to wrap the address in []
      such as
      
      	[2001:db8::c0:ffee]:6379
      
      instead of
      
      	2001:db8::c0:ffee:6379
      
      as the latter format is a technically valid IPv6 address and it is hard
      to distinguish the IPv6 address component from the port unless you know
      the port is supposed to be there.
      ca78446c
    • G
      Expand ip char buffers which are too small for v6. · 96b02dc0
      Geoff Garside 提交于
      Increase the size of character buffers being used to store printable IP
      addresses so that they can safely store IPv6 addresses.
      96b02dc0
    • G
      Mark ip string buffers which could be reduced. · f7d9a92d
      Geoff Garside 提交于
      In two places buffers have been created with a size of 128 bytes which
      could be reduced to INET6_ADDRSTRLEN to still hold a full IP address.
      These places have been marked as they are presently big enough to handle
      the needs of storing a printable IPv6 address.
      f7d9a92d
    • G
      Update clusterCommand to handle AF_INET6 addresses · e6bf4c26
      Geoff Garside 提交于
      Changes the sockaddr_in to a sockaddr_storage. Attempts to convert the
      IP address into an AF_INET or AF_INET6 before returning an "Invalid IP
      address" error. Handles converting the sockaddr from either AF_INET or
      AF_INET6 back into a string for storage in the clusterNode ip field.
      e6bf4c26
    • G
      Update node2IpString to handle AF_INET6 addresses. · 5be83eec
      Geoff Garside 提交于
      Change the sockaddr_in to sockaddr_storage which is capable of storing
      both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family
      to correctly return the printable IP address and port.
      
      Function makes the assumption that the buffer is of at least
      REDIS_CLUSTER_IPLEN bytes in size.
      5be83eec
    • G
      Update REDIS_CLUSTER_IPLEN to INET6_ADDRSTRLEN. · 6181455a
      Geoff Garside 提交于
      Change REDIS_CLUSTER_IPLEN to INET6_ADDRSTRLEN so that the clusterNode
      ip character buffer is big enough to hold an IPv6 address.
      6181455a
    • G
      Update anetPeerToString to handle AF_INET6 addrs. · 23f4d905
      Geoff Garside 提交于
      Change the sockaddr_in to sockaddr_storage which is capable of storing
      both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family
      to correctly return the printable IP address and port.
      23f4d905
    • G
      Update anetTcpAccept to handle AF_INET6 addresses. · fa723d98
      Geoff Garside 提交于
      Change the sockaddr_in to sockaddr_storage which is capable of storing
      both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family
      to correctly return the printable IP address and port.
      fa723d98
    • G
      Update anetResolve to resolve AF_INET6 as well. · e7b34e8d
      Geoff Garside 提交于
      Change the getaddrinfo(3) hints family from AF_INET to AF_UNSPEC to
      allow resolution of IPv6 addresses as well as IPv4 addresses. The
      function will return the IP address of whichever address family is
      preferenced by the operating system. Most current operating systems
      will preference AF_INET6 over AF_INET.
      
      Unfortunately without attempting to establish a connection to the
      remote address we can't know if the host is capable of using the
      returned IP address. It might be desirable to have anetResolve
      accept an additional argument specifying the AF_INET/AF_INET6 address
      the caller would like to receive. Currently though it does not appear
      as though the anetResolve function is ever used within Redis.
      e7b34e8d
    • G
      Update calls to anetResolve to include buffer size · 2345cee3
      Geoff Garside 提交于
      2345cee3
    • G
      Update calls to anetPeerToString to include ip_len. · ee5a6df1
      Geoff Garside 提交于
      ee5a6df1
    • G
      Add missing includes for getpeername. · b39e827d
      Geoff Garside 提交于
      getpeername(2) requires <sys/socket.h> which on some systems also
      requires <sys/types.h>. Include both to avoid compilation warnings.
      b39e827d
    • G
      Add macro to define clusterNode.ip buffer size. · 9cfa02fe
      Geoff Garside 提交于
      Add REDIS_CLUSTER_IPLEN macro to define the size of the clusterNode ip
      character array. Additionally use this macro in inet_ntop(3) calls where
      the size of the array was being defined manually.
      
      The REDIS_CLUSTER_IPLEN is defined as INET_ADDRSTRLEN which defines the
      correct size of a buffer to store an IPv4 address in. The
      INET_ADDRSTRLEN macro itself is defined in the <netinet/in.h> header
      file and should be portable across the majority of systems.
      9cfa02fe
    • G
      Fix cluster.c inet_ntop use of sizeof(n->ip). · 6e894f02
      Geoff Garside 提交于
      Using sizeof with an array will only return expected results if the
      array is created in the scope of the function where sizeof is used. This
      commit changes the inet_ntop calls so that they use the fixed buffer
      value as defined in redis.h which is 16.
      6e894f02
    • G
      Use inet_pton(3) in clusterCommand. · 693b6405
      Geoff Garside 提交于
      Replace inet_aton(3) call with the more future proof inet_pton(3)
      function which is capable of handling additional address families.
      693b6405
    • G
      Use inet_ntop(3) in nodeIp2String & clusterCommand · a6ea707c
      Geoff Garside 提交于
      Replace inet_ntoa(3) calls with the more future proof inet_ntop(3)
      function which is capable of handling additional address families.
      a6ea707c
    • G
      Update anetTcpAccept & anetPeerToString calls. · f5494a42
      Geoff Garside 提交于
      Add the additional ip buffer length argument to function calls of
      anetTcpAccept and anetPeerToString in network.c and cluster.c
      f5494a42
    • G
      Use inet_ntop(3) in anet. #apichange · ef839f90
      Geoff Garside 提交于
      Replace inet_ntoa(3) calls with the more future proof inet_ntop(3)
      function which is capable of handling additional address families.
      
      API Change: anetTcpAccept() & anetPeerToString() additional argument
        additional argument required to specify the length of the character
        buffer the IP address is written to in order to comply with
        inet_ntop(3) function semantics.
      ef839f90
    • G
      Use getaddrinfo(3) in a anetTcpServer. · e0cb2435
      Geoff Garside 提交于
      Change anetTcpServer() function to use getaddrinfo(3) to perform
      address resolution, socket creation and binding. Resolved addresses
      are limited to those reachable by the AF_INET address family.
      e0cb2435
    • G
      Use getaddrinfo(3) in anetTcpGenericConnect. · 0e01ce1b
      Geoff Garside 提交于
      Change anetTcpGenericConnect() function to use getaddrinfo(3) to
      perform address resolution, socket creation and connection. Resolved
      addresses are limited to those reachable by the AF_INET family.
      0e01ce1b
    • G
      Add anetSetReuseAddr(err, fd) static function. · 580b7dce
      Geoff Garside 提交于
      Extract setting SO_REUSEADDR socket option into separate function
      so the same code can be more easily used by anetCreateSocket and
      other functions.
      580b7dce
    • G
      Use getaddrinfo(3) in anetResolve. #apichange · 071963c8
      Geoff Garside 提交于
      Change anetResolve() function to use getaddrinfo(3) to resolve hostnames.
      Resolved hostnames are limited to those reachable by the AF_INET address
      family.
      
      API Change: anetResolve requires additional argument.
        additional argument required to specify the length of the character
        buffer the IP address is written to in order to comply with
        inet_ntop(3) function semantics. inet_ntop(3) replaces inet_ntoa(3)
        as it has been designed to be compatible with more address families.
      071963c8
    • A
      64b3b9b1
  2. 05 7月, 2013 7 次提交
  3. 03 7月, 2013 2 次提交
    • A
      redis-cli: introduced --pipe-timeout. · 1135e9fa
      antirez 提交于
      When in --pipe mode, after all the data transfer to the server is
      complete, now redis-cli waits at max the specified amount of
      seconds (30 by default, use 0 to wait forever) without receiving any
      reply at all from the server. After this time limit the operation is
      aborted with an error.
      
      That's related to issue #681.
      1135e9fa
    • A
      redis-cli --pipe: send final ECHO in a safer way. · fbb97c6b
      antirez 提交于
      If the protocol read from stdin happened to contain grabage (invalid
      random chars), in the previous implementation it was possible to end
      with something like:
      
      dksfjdksjflskfjl*2\r\n$4\r\nECHO....
      
      That is invalid as the *2 should start into a new line. Now we prefix
      the ECHO with a CRLF that has no effects on the server but prevents this
      issues most of the times.
      
      Of course if the offending wrong sequence is something like:
      
      $3248772349\r\n
      
      No one is going to save us as Redis will wait for data in the context of
      a big argument, so this fix does not cover all the cases.
      
      This partially fixes issue #681.
      fbb97c6b
  4. 02 7月, 2013 5 次提交
  5. 28 6月, 2013 2 次提交
  6. 27 6月, 2013 1 次提交