Skip to content

Commit bc2ce9d

Browse files
committed
Merge version 2.8.18 from antirez into 2.8
Conflicts: deps/linenoise/linenoise.c deps/lua/src/lua_cjson.c redis.conf src/anet.c src/config.c src/networking.c src/object.c src/rdb.c src/redis.c src/redis.h src/replication.c tests/support/server.tcl
2 parents 8d5716c + d6ada4d commit bc2ce9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2919
-920
lines changed

00-RELEASENOTES

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,36 @@ HIGH: There is a critical bug that may affect a subset of users. Upgrade!
1414
CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP.
1515
--------------------------------------------------------------------------------
1616

17+
--[ Redis 2.8.18 ] Release date: 4 Dec 2014
18+
19+
# UPGRADE URGENCY: LOW for both Redis and Sentinel. This release mostly
20+
adds new features to Redis, and contains non critical
21+
fixes.
22+
23+
* [FIX] Linenoise updated to be more VT100 compatible. (Salvatore Sanfilippo)
24+
* [FIX] A number of typos fixed inside comments. (Various authors)
25+
* [FIX] redis-cli no longer quits after long timeouts. (Matt Stancliff)
26+
* [FIX] Test framework improved to detect never terminating scripts, cleanup
27+
instances on crashes. (Salvatore Sanfilippo)
28+
* [FIX] PFCOUNT can be used on slaves now. (Salvatore Sanfilippo)
29+
* [FIX] ZSCAN no longer report very small scores as 0. (Matt Stancliff,
30+
Michael Grunder, Salvatore Sanfilippo)
31+
* [FIX] Don't show the ASCII logo if syslog is enabled. Redis is now
32+
an Enterprise Grade product. (Salvatore Sanfilippo)
33+
34+
* [NEW] EXPERIMENTAL: Diskless replication, for more info check the doc at
35+
http://redis.io/topics/replication. (Salvatore Sanfilippo).
36+
* [NEW] Transparent Huge Pages detection and reporting in logs and
37+
LATENCY DOCTOR output. (Salvatore Sanfilippo)
38+
* [NEW] Many Lua scripting enhancements: Bitops API, cjson upgrade and tests,
39+
cmsgpack upgrade. (Matt Stancliff)
40+
* [NEW] Total and instantaneous Network bandwidth tracking in INFO.
41+
* [NEW] DEBUG POPULATE two args form implemented (old form still works).
42+
The second argument is the key prefix. Default is "key:" (Salvatore
43+
Sanfilippo)
44+
* [NEW] Check that tcp-backlog is matched by /proc/sys/net/core/somaxconn, and
45+
warn about it if not. (Salvatore Sanfilippo)
46+
1747
--[ Redis 2.8.17 ] Release date: 19 Sep 2014
1848

1949
# UPGRADE URGENCY: HIGH for Redis Sentinel.

BUGS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Plese check https://github.com/antirez/redis/issues
1+
Please check https://github.com/antirez/redis/issues

deps/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ifeq ($(uname_S),SunOS)
5858
LUA_CFLAGS= -D__C99FEATURES__=1
5959
endif
6060

61-
LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI $(CFLAGS)
61+
LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL $(CFLAGS)
6262
LUA_LDFLAGS+= $(LDFLAGS)
6363
# lua's Makefile defines AR="ar rcu", which is unusual, and makes it more
6464
# challenging to cross-compile lua (and redis). These defines make it easier

deps/hiredis/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static redisContext *select_database(redisContext *c) {
5151
assert(reply != NULL);
5252
freeReplyObject(reply);
5353

54-
/* Make sure the DB is emtpy */
54+
/* Make sure the DB is empty */
5555
reply = redisCommand(c,"DBSIZE");
5656
assert(reply != NULL);
5757
if (reply->type == REDIS_REPLY_INTEGER && reply->integer == 0) {

deps/linenoise/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
linenoise_example*
1+
linenoise_example
2+
*.dSYM
3+
history.txt

deps/linenoise/README.markdown

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# Linenoise
22

3-
A minimal, zero-config, BSD licensed, readline replacement.
3+
A minimal, zero-config, BSD licensed, readline replacement used in Redis,
4+
MongoDB, and Android.
45

5-
News: linenoise is now part of [Android](http://android.git.kernel.org/?p=platform/system/core.git;a=tree;f=liblinenoise;h=56450eaed7f783760e5e6a5993ef75cde2e29dea;hb=HEAD Android)!
6+
* Single and multi line editing mode with the usual key bindings implemented.
7+
* History handling.
8+
* Completion.
9+
* About 1,100 lines of BSD license source code.
10+
* Only uses a subset of VT100 escapes (ANSI.SYS compatible).
611

712
## Can a line editing library be 20k lines of code?
813

914
Line editing with some support for history is a really important feature for command line utilities. Instead of retyping almost the same stuff again and again it's just much better to hit the up arrow and edit on syntax errors, or in order to try a slightly different command. But apparently code dealing with terminals is some sort of Black Magic: readline is 30k lines of code, libedit 20k. Is it reasonable to link small utilities to huge libraries just to get a minimal support for line editing?
1015

1116
So what usually happens is either:
1217

13-
* Large programs with configure scripts disabling line editing if readline is not present in the system, or not supporting it at all since readline is GPL licensed and libedit (the BSD clone) is not as known and available as readline is (Readl world example of this problem: Tclsh).
18+
* Large programs with configure scripts disabling line editing if readline is not present in the system, or not supporting it at all since readline is GPL licensed and libedit (the BSD clone) is not as known and available as readline is (Real world example of this problem: Tclsh).
1419
* Smaller programs not using a configure script not supporting line editing at all (A problem we had with Redis-cli for instance).
1520

1621
The result is a pollution of binaries without line editing support.
@@ -19,27 +24,29 @@ So I spent more or less two hours doing a reality check resulting in this little
1924

2025
## Terminals, in 2010.
2126

22-
Apparently almost every terminal you can happen to use today has some kind of support for VT100 alike escape sequences. So I tried to write a lib using just very basic VT100 features. The resulting library appears to work everywhere I tried to use it.
27+
Apparently almost every terminal you can happen to use today has some kind of support for basic VT100 escape sequences. So I tried to write a lib using just very basic VT100 features. The resulting library appears to work everywhere I tried to use it, and now can work even on ANSI.SYS compatible terminals, since no
28+
VT220 specific sequences are used anymore.
2329

24-
Since it's so young I guess there are a few bugs, or the lib may not compile or work with some operating system, but it's a matter of a few weeks and eventually we'll get it right, and there will be no excuses for not shipping command line tools without built-in line editing support.
25-
26-
The library is currently less than 400 lines of code. In order to use it in your project just look at the *example.c* file in the source distribution, it is trivial. Linenoise is BSD code, so you can use both in free software and commercial software.
30+
The library is currently about 1100 lines of code. In order to use it in your project just look at the *example.c* file in the source distribution, it is trivial. Linenoise is BSD code, so you can use both in free software and commercial software.
2731

2832
## Tested with...
2933

3034
* Linux text only console ($TERM = linux)
3135
* Linux KDE terminal application ($TERM = xterm)
3236
* Linux xterm ($TERM = xterm)
37+
* Linux Buildroot ($TERM = vt100)
3338
* Mac OS X iTerm ($TERM = xterm)
3439
* Mac OS X default Terminal.app ($TERM = xterm)
3540
* OpenBSD 4.5 through an OSX Terminal.app ($TERM = screen)
3641
* IBM AIX 6.1
3742
* FreeBSD xterm ($TERM = xterm)
43+
* ANSI.SYS
3844

3945
Please test it everywhere you can and report back!
4046

4147
## Let's push this forward!
4248

43-
Please fork it and add something interesting and send me a pull request. What's especially interesting are fixes, new key bindings, completion.
49+
Patches should be provided in the respect of linenoise sensibility for small
50+
easy to understand code.
4451

4552
Send feedbacks to antirez at gmail

deps/linenoise/example.c

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <stdio.h>
22
#include <stdlib.h>
3+
#include <string.h>
34
#include "linenoise.h"
45

56

@@ -10,16 +11,52 @@ void completion(const char *buf, linenoiseCompletions *lc) {
1011
}
1112
}
1213

13-
int main(void) {
14+
int main(int argc, char **argv) {
1415
char *line;
16+
char *prgname = argv[0];
1517

18+
/* Parse options, with --multiline we enable multi line editing. */
19+
while(argc > 1) {
20+
argc--;
21+
argv++;
22+
if (!strcmp(*argv,"--multiline")) {
23+
linenoiseSetMultiLine(1);
24+
printf("Multi-line mode enabled.\n");
25+
} else if (!strcmp(*argv,"--keycodes")) {
26+
linenoisePrintKeyCodes();
27+
exit(0);
28+
} else {
29+
fprintf(stderr, "Usage: %s [--multiline] [--keycodes]\n", prgname);
30+
exit(1);
31+
}
32+
}
33+
34+
/* Set the completion callback. This will be called every time the
35+
* user uses the <tab> key. */
1636
linenoiseSetCompletionCallback(completion);
37+
38+
/* Load history from file. The history file is just a plain text file
39+
* where entries are separated by newlines. */
1740
linenoiseHistoryLoad("history.txt"); /* Load the history at startup */
41+
42+
/* Now this is the main loop of the typical linenoise-based application.
43+
* The call to linenoise() will block as long as the user types something
44+
* and presses enter.
45+
*
46+
* The typed string is returned as a malloc() allocated string by
47+
* linenoise, so the user needs to free() it. */
1848
while((line = linenoise("hello> ")) != NULL) {
19-
if (line[0] != '\0') {
49+
/* Do something with the string. */
50+
if (line[0] != '\0' && line[0] != '/') {
2051
printf("echo: '%s'\n", line);
21-
linenoiseHistoryAdd(line);
22-
linenoiseHistorySave("history.txt"); /* Save every new entry */
52+
linenoiseHistoryAdd(line); /* Add to the history. */
53+
linenoiseHistorySave("history.txt"); /* Save the history on disk. */
54+
} else if (!strncmp(line,"/historylen",11)) {
55+
/* The "/historylen" command will change the history len. */
56+
int len = atoi(line+11);
57+
linenoiseHistorySetMaxLen(len);
58+
} else if (line[0] == '/') {
59+
printf("Unreconized command: %s\n", line);
2360
}
2461
free(line);
2562
}

0 commit comments

Comments
 (0)