summaryrefslogtreecommitdiff
path: root/hiredis.h
AgeCommit message (Collapse)Author
2020-02-28Bump version to 0.15.0michael-grunder
2020-01-28Safe allocation wrappers (#754)Michael Grunder
Create allocation wrappers with a configurable OOM handler (defaults to abort()). See #752, #747
2020-01-01fix spelling mistakesShooterIT
2019-09-01Use a const funcs in redisContext.Yossi Gottlieb
2019-08-29wip: SSL code reorganization, see #705.Yossi Gottlieb
2019-08-27Merge pull request #697 from yossigo/resp3Mark Nunberg
Port RESP3 support from Redis.
2019-08-09MinGW fix: Use _MSC_VER instead of _WIN32 where appropriateMarcus Geelnard
Use _MSC_VER (instead of _WIN32) for things that are specific for Visual Studio. Also remove #include <winsock2.h> from hiredis.h, as it leaks too many symbols and defines into the global namespace, which is undesirable for a public interface header. Anyone who uses the the affected parts of the hiredis API needs to include the appropriate headers anyway in order to declare struct timeval variables.
2019-08-04RESP3 support changes from Redis.Yossi Gottlieb
This corresponds to commits d5c54f0b..bea09a7f in the redis repository.
2019-04-13Fix Compile Error On Windows (Visual Studio)jinjiazhang
2019-04-01Port network layer to Winsockm
With this change, Hiredis builds with MinGW and runs on Windows.
2019-04-01Introduce a redisFD typem
The redisFD type should be equal to the system native socket file desciptor type (for POSIX, this is a plain int). We also introduce the REDIS_INVALID_FD value, which maps to -1 on POSIX systems.
2019-02-21Allow option for async connections to not automatically freeMark Nunberg
2019-02-20Support SNIvalentino
2019-02-20Fix bug in options macroMark Nunberg
2019-02-20Provide option-struct initializationMark Nunberg
This reduces the boilerplate of all the redisConnectXXX functions, and allows us to provide more connection options in the future.
2019-02-20Initial SSL (sync) implementationMark Nunberg
2018-09-25Call connect(2) again for non-blocking connectMark Nunberg
This retrieves the actual error which occurred, as getsockopt is not always reliable in this regard.
2018-09-25Prepare for the 0.14.0 releaseTom Lee
SONAME bumped to 0.14 because we've broken ABI compatibility with 0.13.x
2018-04-30Drop __redis_strerror_rJustin Brewer
Since _GNU_SOURCE is now guaranteed to be unset, it is no longer necessary to support the GNU-specific version of strerror_r. Drop __redis_strerror_r from the header, and call strerror_r directly. This breaks any external users of this macro, but they shouldn't have been using it in the first place. Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2017-03-22suppress gcc complaintIchito Nagata
2016-10-25Remove trailing comma in redisConnectionType enumDonald Whyte
Remove trailing comma in last value of `redisConnectionType` enum. This causes a compiler warning on Solaris compilers. I'd like to build this on Solaris with `-Werror`. However, due to the trailing comma, I cannot do that. This PR removes the trailing comma, which should prevent it causing compiler warnings on any architecture.
2016-04-20fix: Change string length type to size_tJan-Erik Rediger
2016-04-20Auto merge of #391 - redis:catch-error-buf-overflow, r=badboynot-a-robot
Prevent buffer overflow when formatting the error strncat might copy n+1 bytes (n bytes from the source plus a terminating nul byte). Also strncat appends after the first found nul byte. But all we pass is a buffer we might not have zeroed out already. Closes #380
2015-11-18Prevent buffer overflow when formatting the errorJan-Erik Rediger
strncat might copy n+1 bytes (n bytes from the source plus a terminating nul byte). Also strncat appends after the first found nul byte. But all we pass is a buffer we might not have zeroed out already. Closes #380
2015-10-28fixing typoscharsyam
2015-09-16Release version 0.13.3Jan-Erik Rediger
2015-08-25Release version 0.13.2Jan-Erik Rediger
2015-07-27Use stable soname versionJan-Erik Rediger
2015-05-03Release version 0.13.1Jan-Erik Rediger
2015-04-30Renamed redisContext struct member 'unix' to 'unix_sock' to avoid ↵Alex Balashov
encountering defined constant 'unix' in GNU C environment (see commit d8145d79ce715054980938c751067ebaa541573c). Not all code using hiredis can compile using '-std=c99', and/or not all users are able to easily make that change to the build process of various open-source projects, so it is more pragmatic to choose a different identifier that does not impose this requirement.
2015-04-16Release version 0.13.0Jan-Erik Rediger
2015-04-16Change copyright date and add copyright holderJan-Erik Rediger
2015-04-16Document reconnect methodJan-Erik Rediger
2015-04-16Implement a reconnect method for the client contextJan-Erik Rediger
Originally implemented by @abedra as part of #306. In case a write or read times out, we force an error state, because we can't guarantuee that the next read will get the right data. Instead we need to reconnect to have a clean-state connection, which is now easily possible with this method.
2015-01-26Release hiredis 0.12.1Matt Stancliff
Major fix: - `make install` now works properly Minor fix: - `make test` now works after `make 32bit` on a 64-bit platform - added more automated travis tests
2015-01-22Increase version to 0.12.0Matt Stancliff
2015-01-22Improve digit counting for multibulk creationMatt Stancliff
This replaces the old intlen() implementation with a slightly faster way of counting digits. Implementation taken from the same place where digits10() in redis/src/util.c came from. The old 'intlen' allowed negative inputs, but no usage in hiredis was passing negative numbers, so that ability is removed. Also, the new implementation can count higher (uint64_t) instead of limited to just int as before. Fixes #295 by replacing implementation
2015-01-05Fix errno error buffers to not clobber errorsMatt Stancliff
The strerror_r API has two flavors depending on system options. The bad flavor uses a static buffer for returning results, so if you save the pointer from strerror_r, the string you're referencing becomes useless if anybody else calls strerror_r again The good flavor does what you expect: it writes the error to your buffer. This commit uses strerror_r directly if it's a good version or copies the static buffer into our private buffer if it's a bad version. Thanks to gemorin for explaining the problem and drafting a fix. Fixes #239
2015-01-05Refactor reading code into read.ctzickel
Makes hiredis reading functions easier to include in external projects [fixed all merge conflicts against current version] Closes #249
2015-01-05Add API to free hiredis (sds) formattingsMatt Stancliff
External callers may not know about sdsfree, so let's give them an easy way to know how to free their sds result.
2015-01-05Add API to free hiredis (char *) formattingsMareq
[Cleaned up: - name of function: freeRedis... -> redisFree... - return value of function (free doesn't return anything) - parameter type for function. - we don't need to free a char**, the char** is just for returning from the assignment functoin.] Closes #250
2015-01-05Add support for SO_REUSEADDRmike
[This introduces some new API functions.] * Adds new flag to the connection context indicating SO_REUSEADDR should be set. * Adds max number of retries constant for when connect() hits EADDRNOTAVAIL. * Adds new function, redisAsyncConnectBindWithReuse(), letting clients enable this functionality. [Removed trailing whitespace in new header lines.] Closes #264
2015-01-05Improve redisAppendCommandArgv performancemichael-grunder
OK, perhaps the second time is a charm. I forgot that I had hiredis forked from a long time ago, so the initial pull request was hosed. :) * Pulled in sdscatfmt() from Redis, and modified it to accept a size_t (%T) style format specifier. * Pulled in sdsll2str() and sdsull2str() from Redis (needed by sdscatfmt). * Added a new method, redisFormatSdsCommandArgv() which takes and sds* as the target, rather than char* (and uses sdscatfmt instead of sprintf for the construction). I get roughly the following improvement: Old: 1.044806 New: 0.481620 The benchmark code itself can be found here: https://gist.github.com/michael-grunder/c92ef31bb632b3d0ad81 Closes #260
2014-04-09Fix const correctnessPieter Noordhuis
2014-04-09Add new redisAppendFormatedCommand with testsAxel Etcheverry
Closes #202
2014-04-09Add redisConnectFd() and redisFreeKeepFd()Eddy Jansson
These allows for easier integration of hiredis with external code that wants to manage its fds, say for instance in a pool. Closes #223
2014-04-08Add ability to bind source address on connectMatt Stancliff
Some environments require binding to specific source addresses instead of letting the system determine which IP a connection should originate from. Closes #233
2013-07-10Mark the timeout parameter as const in various functionsNoah Williamsson
The struct timeval argument in redisConnectWithTimeout(), redisConnectUnixWithTimeout(), redisSetTimeout(), redisContextSetTimeout(), redisContextConnectTcp() and redisContextConnectUnix() is never modified and can therefore be marked as const. Signed-off-by: Noah Williamsson <noah.williamsson@gmail.com>
2013-04-30Make KeepAlive optionalAllen.Dou
Make Connection KeepAlive being optional instead of default.
2013-04-19SetKeepAliveAllen.Dou
Keep client alive even though no command was sent to server for a long time.