Commit Graph

777 Commits

Author SHA1 Message Date
not-a-robot[bot]
7d99652241 Merge #523
523: Fix leak if setsockopt fails r=badboy
2017-07-15 14:05:56 +00:00
Jan-Erik Rediger
4d8f3fb207 Merge pull request #532 from amallia/assert-side-effects
Assert statement calls a function which has side effects
2017-06-16 08:42:17 +02:00
amallia
3c32344a41 Small fixes 2017-06-15 20:59:37 +01:00
amallia
b46413647f Assert statement calls a function which has side effects 2017-06-15 20:33:23 +01:00
eldarko
6114da6429 Fix compilation on FreeBSD 10.3 with default compiler 2017-05-17 11:03:24 +03:00
Frederik Deweerdt
706129a161 Don't pass a negative value to __redisAsyncCommand if redisFormatSdsCommandArgv fails 2017-05-15 09:20:03 -07:00
Frederik Deweerdt
e21c9c6729 Fix leak if setsockopt fails 2017-05-15 09:14:12 -07:00
Jan-Erik Rediger
97cd8157f7 Merge pull request #514 from zfzsoft/patch-1
redisLibeventCleanup will be leak
2017-04-07 21:12:58 +02:00
Jan-Erik Rediger
2d37f60860 Merge pull request #516 from redis/changed-cygwin
chore(CI): Skip installing Cygwin
2017-04-07 21:12:33 +02:00
Jan-Erik Rediger
fa4d611708 chore(CI): Skip installing Cygwin 2017-04-07 17:42:43 +02:00
Jan-Erik Rediger
f330459ebf Merge pull request #473 from trustfarm-dev/master
Build error when make examples , patch with glib-2.0 positon move will solve.
2017-04-07 16:50:17 +02:00
zfz
515228e5a1 Update libevent.h
event_del can not free the "e->rev" and "e->wev",that will leak when reconnect the redis
2017-03-28 16:46:55 +08:00
Jan-Erik Rediger
29cb95f4f6 Merge pull request #513 from i110/master
suppress gcc complaint
2017-03-22 17:03:16 +01:00
Ichito Nagata
2ec7740c3a suppress gcc complaint 2017-03-22 17:03:52 +09:00
Hyungjin Kim
d4699989ca Use cached local variable instead using accessor 2017-01-30 20:01:01 +09:00
Hyungjin Kim
be76c56b51 Consider sub by pattern when clear subscribed flag 2017-01-30 20:00:04 +09:00
Jan-Erik Rediger
c9b72f97f8 Merge pull request #499 from jinq0123/fixbug/redisSetErrorFromErrno
Fix __redisSetErrorFromErrno() can not get error string.
2017-01-23 17:03:14 +01:00
Jin Qing
25cd884f6b Fix __redisSetErrorFromErrno() can not get error string.
snprintf() may change errno.
2016-12-30 23:13:02 +08:00
not-a-robot
33152ad163 Auto merge of #429 - xinchuantao:master, r=badboy
using new version libevent
2016-12-09 11:37:25 +01:00
not-a-robot
b4f9fc1a2a Auto merge of #468 - paul-scott:master, r=badboy
Prevented uv adapter from calling write when context has been freed

The `redisLibuvPoll` function can be called with both the `UV_READABLE` and `UV_WRITABLE` flags set at the same time.  Calling `redisAsyncHandleRead` can lead to a disconnect and the context being cleaned up/freed.  If this happens then `redisAsyncHandleWrite` should not be called otherwise memory read/write errors and duplicate freeing will occur.

These changes prevent this from happening by having the `redisLibuvCleanup` callback indicate that the context has been cleaned.  This is done indirectly by setting the context to a null pointer, maybe someone can come up with a cleaner way.
2016-12-09 11:12:16 +01:00
Jan-Erik Rediger
8636d90821 Avoid unchecked malloc
Closes #471
2016-12-09 10:51:26 +01:00
Jan-Erik Rediger
afdef3e6ec Merge pull request #479 from DonaldWhyte/patch-1
Remove trailing comma in redisConnectionType enum
2016-11-04 15:22:16 +01:00
Donald Whyte
41b07dab5e Remove trailing comma in redisConnectionType enum
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-10-25 09:25:24 +01:00
Trustfarm-heart
06eedd8a24 Build error patch with glib-2.0
In case of some glib-2.0 linker error ,
make examples 
can't link with glib2.0,  in this case -lglib-2.0  to after includes and move to last will solve the issues.
2016-10-10 04:17:28 +09:00
Hyungjin Kim
073dc84399 Counting pending subscribe. Fix #396 2016-09-30 00:26:32 +09:00
Paul Scott
cbb956567b Prevented uv adapter from calling write when context has been freed 2016-09-19 11:48:54 +10:00
not-a-robot
5f98e1d35d Auto merge of #445 - xxvv:master, r=badboy
fix: should close socket fd when retry connect (tcp)
2016-07-09 13:26:58 +02:00
WSL
64d1ec8342 fix: should close socket fd when retry connet remote (tcp) 2016-07-07 17:02:06 +08:00
not-a-robot
b7205d35fd Auto merge of #440 - redis:pr-438, r=badboy
Test on OSX

Thanks to @tnm & @xor-gate
2016-06-20 11:50:03 +02:00
not-a-robot
847f3fe5c7 Auto merge of #428 - avatli:patch-1, r=badboy
Update sds.h

Fixing sds.h for building hiredis in cpp project
2016-06-20 11:37:14 +02:00
not-a-robot
ef372ed2f0 Auto merge of #439 - tnm:fmacros-fix, r=badboy
Do not define _XOPEN_SOURCE for OS X

redis@bb1747b appears to have introduced a build regression for OS X (and possibly elsewhere, I've only tested on a local Mac environment) — in master right now `make` reliably fails on OS X as reported in redis#431.

There looks to be another PR to fix the issue in redis#433.

This PR here simply returns to the previous behavior on OS X in a minimally-invasive way. There are of course a few different ways to do this with the directives; feel free to do something different, I just care that master can build on OS X 🙇
2016-06-20 11:37:10 +02:00
Jan-Erik Rediger
9deb78140f chore(CI): Exclude valgrind jobs on OSX 2016-06-20 11:08:34 +02:00
Ted Nyman
bc0ea5c466 Do not define _XOPEN_SOURCE for OS X
Resolves failed `make` on OS X.
2016-06-19 22:14:41 -07:00
Ted Nyman
16a459d008 Add a before_script for the OS X environment 2016-06-19 22:05:34 -07:00
Ted Nyman
fa3774081e Test on Travis for both linux and osx 2016-06-19 21:49:44 -07:00
Chris.Xin
386802e809 using new version libevent 2016-05-20 18:55:57 +08:00
Ali Volkan ATLI
f5b32e2474 Update sds.h
Fixing sds.h for building hiredis in cpp project
2016-05-14 23:11:33 +03:00
not-a-robot
e30db1a3be Auto merge of #427 - redis:pr-426, r=badboy
Pr 426

Closes #426, now with test
2016-05-14 11:45:18 +02:00
Jan-Erik Rediger
8655a6ac7a test: Add regression test for sds argv formatting 2016-05-14 11:26:18 +02:00
Paulino Huerta
360a0646bb Typo format in redisFormatSdsCommandArgv function
this issue is very significant, because not allow the proper execution of the "function redisCommandArgv". The server returns "invalid bulk length".
Thanks!
2016-05-14 01:53:48 +02:00
not-a-robot
e93c05a7aa Auto merge of #378 - thomaslee:tom_fix_kfreebsd, r=badboy
Fix strerror_r on some esoteric platforms

Defining _XOPEN_SOURCE=1 causes strange behavior on Debian kfreebsd archs -- i.e. the GNU userspace with FreeBSD kernel -- when _GNU_SOURCE is not defined (the default).

Not sure I fully understand the bizarre semantics, but it seems to use the XSI-compliant interface (int strerror_r(int, char*, size_t)) but the GNU implementation (char *strerror_r(int, char*, size_t)) such that strerror_r returns 32-bits of a 64-bit char * on x86_64 kfreebsd. We would expect strerror_r to return zero when using the XSI-compliant strerror_r implementation or a 64-bit char* when using the GNU version. Instead, we get something in between!

Unless I'm missing something, being more explicit about what version of _XOPEN_SOURCE we want seems to be the prudent thing to do here -- and if folks want the GNU implementation of strerror_r for some reason they can always -D_GNU_SOURCE explicitly.
2016-05-12 09:44:47 +02:00
not-a-robot
8ef4c472f8 Auto merge of #418 - redis:debug-flags, r=badboy
fix: Rename DEBUG to DEBUG_FLAGS

This avoids issues with environments where DEBUG is set to an arbitrary
value to force debug mode in other tools.

BREAKING CHANGE: This breaks builds that explicitely set `DEBUG` to
                 some value (even the empty value).
                 To get back the old behaviour change the `DEBUG_FLAGS`
                 variable now.

Cloes #381
2016-04-20 18:49:22 +02:00
Jan-Erik Rediger
0616677c93 docs: Add breaking change note about makefile variable 2016-04-20 18:48:39 +02:00
Jan-Erik Rediger
acf8950041 fix: Rename DEBUG to DEBUG_FLAGS
This avoids issues with environments where DEBUG is set to an arbitrary
value to force debug mode in other tools.

BREAKING CHANGE: This breaks builds that explicitely set `DEBUG` to
                 some value (even the empty value).
                 To get back the old behaviour change the `DEBUG_FLAGS`
                 variable now.
2016-04-20 18:46:35 +02:00
not-a-robot
81e8176bac Auto merge of #417 - redis:thread-safety, r=badboy
docs: Note about thread-safety
2016-04-20 18:31:34 +02:00
not-a-robot
35a16d6f69 Auto merge of #416 - redis:string-len-size_t, r=badboy
fix: Change string length type to size_t
2016-04-20 18:17:33 +02:00
not-a-robot
278745d840 Auto merge of #415 - redis:new-readme, r=badboy
docs: Add changelog for upcoming version and note about status of README
2016-04-20 17:55:43 +02:00
Jan-Erik Rediger
b2213b7643 docs: Note about thread-safety 2016-04-20 17:49:20 +02:00
not-a-robot
a91afd746b Auto merge of #379 - thomaslee:tom_test_race, r=badboy
Fix potential race in 'invalid timeout' tests

It's possible for the call to connect() to succeed on the very first try, in which case the logic for checking for invalid timeout fields is never executed. When this happens, the tests fail because they expect a REDIS_ERR_IO but no such failure has occurred.

Tests aside, this is a potential source of irritating and hard-to-find intermittent bugs.

This patch forces the validation to occur early so that we get predictable behavior whenever an invalid timeout is specified.
2016-04-20 17:42:04 +02:00
not-a-robot
d3c7df33a1 Auto merge of #406 - DongwenHuang:patch-1, r=badboy
Update read.c

static char *seekNewline(char *s, size_t len)  :
this function can not parse the string,such as "hello world\r". the case that  the last char is '\r'.
2016-04-20 17:24:30 +02:00