1. 08 Apr, 2014 2 commits
    • Matt Stancliff's avatar
      Fix potential undefined struct read · 61eeedbe
      Matt Stancliff authored
      All the assignments to cb are inside conditionals, so it's
      vaguely possible it never gets initialized before we try
      to read from it with (cb.fn == NULL).
      
      Condition discovered with scan-build.
      
      Closes #229
      61eeedbe
    • Matt Stancliff's avatar
      Remove possiblity of multiple close on same fd · 7f0c7a29
      Matt Stancliff authored
      With all the async connects and disconnects and error handling
      going on in hiredis, we need to centralize how we close our fd
      and set it so it doesn't get re-closed.  Prior to this commit,
      sometimes we'd close(fd), run an async error handler, then
      call close(fd) again.
      
      To stop multiple closes, we now set fd to -1 after we free it,
      but that requires not passing fd as an independent argument to
      functions.
      
      This commit moves all fd usage to c->fd.  Since the context
      has a fd field and all functions receive the context, it makes
      more sense to use the fd inside of c instead of passing along fd
      as an independent argument.
      
      Also, by only using c->fd, we can set c->fd after we close it to
      signify we shouldn't re-close the same fd again.
      
      This does change one semi-public interface function redisCheckSocketError()
      to only take (context) instead of (context, fd).  A search on github
      returned zero occasions of people using redisCheckSocketError()
      outside of net.{c,h} in hiredis itself.
      
      Commit inspired by the bug report at:
      https://groups.google.com/forum/#!topic/redis-db/mQm46XkIPOY
      
      Thanks go out to Thijs for trying high-frequency reconnects on
      a host that isn't there.
      
      Closes #230
      7f0c7a29
  2. 15 Jan, 2014 1 commit
  3. 11 Jul, 2013 1 commit
  4. 22 Jan, 2013 2 commits
  5. 12 Nov, 2012 1 commit
  6. 01 Aug, 2012 1 commit
  7. 11 Jul, 2012 1 commit
  8. 11 Jul, 2011 1 commit
  9. 27 Jun, 2011 2 commits
  10. 18 Jun, 2011 1 commit
  11. 29 May, 2011 1 commit
  12. 24 May, 2011 2 commits
  13. 21 Apr, 2011 3 commits
  14. 14 Jan, 2011 1 commit
  15. 10 Jan, 2011 1 commit
  16. 31 Dec, 2010 7 commits
  17. 29 Dec, 2010 1 commit
  18. 28 Dec, 2010 5 commits
  19. 16 Dec, 2010 1 commit
  20. 07 Dec, 2010 1 commit
  21. 01 Dec, 2010 1 commit
  22. 15 Nov, 2010 1 commit
  23. 03 Nov, 2010 1 commit
  24. 02 Nov, 2010 1 commit
    • Pieter Noordhuis's avatar
      Change error reporting to have an explicit type · ffa8666a
      Pieter Noordhuis authored
      When there is an I/O error, errno should be used to find out what is
      wrong. In other cases, errno cannot be used. So, use an explicit type in
      Hiredis to define the different error scenarios that can occur.
      ffa8666a