summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaige Ye <yekaige2010@gmail.com>2023-03-15 17:05:42 +0800
committerGitHub <noreply@github.com>2023-03-15 11:05:42 +0200
commit5360350e4aeaa2c7498be4af29aee449f0ee49ad (patch)
treecea49737c24b6d2d8d2d0997f55453892c6994be
parent9344f654c6227f30adf8bafd49b4218357c438b7 (diff)
downloadredis-5360350e4aeaa2c7498be4af29aee449f0ee49ad.tar.gz
cleanup NBSP characters in comments (#10555)
Replace NBSP character (0xC2 0xA0) with space (0x20). Looks like that was originally added due to misconfigured editor which seems to have been fixed by now.
-rw-r--r--src/module.c48
-rw-r--r--src/networking.c4
-rw-r--r--src/replication.c20
-rw-r--r--src/resp_parser.c2
-rw-r--r--src/script_lua.c4
5 files changed, 39 insertions, 39 deletions
diff --git a/src/module.c b/src/module.c
index a6c1b552c..418c5bd32 100644
--- a/src/module.c
+++ b/src/module.c
@@ -2576,30 +2576,30 @@ RedisModuleString* RM_HoldString(RedisModuleCtx *ctx, RedisModuleString *str) {
if (ctx != NULL) {
/*
* Put the str in the auto memory management of the ctx.
-         * It might already be there, in this case, the ref count will
-         * be 2 and we will decrease the ref count twice and free the
-         * object in the auto memory free function.
-         *
-         * Why we can not do the same trick of just remove the object
-         * from the auto memory (like in RM_RetainString)?
-         * This code shows the issue:
-         *
-         * RM_AutoMemory(ctx);
-         * str1 = RM_CreateString(ctx, "test", 4);
-         * str2 = RM_HoldString(ctx, str1);
-         * RM_FreeString(str1);
-         * RM_FreeString(str2);
-         *
-         * If after the RM_HoldString we would just remove the string from
-         * the auto memory, this example will cause access to a freed memory
-         * on 'RM_FreeString(str2);' because the String will be free
-         * on 'RM_FreeString(str1);'.
-         *
-         * So it's safer to just increase the ref count
-         * and add the String to auto memory again.
-         *
-         * The limitation is that it is not possible to use RedisModule_StringAppendBuffer
-         * on the String.
+ * It might already be there, in this case, the ref count will
+ * be 2 and we will decrease the ref count twice and free the
+ * object in the auto memory free function.
+ *
+ * Why we can not do the same trick of just remove the object
+ * from the auto memory (like in RM_RetainString)?
+ * This code shows the issue:
+ *
+ * RM_AutoMemory(ctx);
+ * str1 = RM_CreateString(ctx, "test", 4);
+ * str2 = RM_HoldString(ctx, str1);
+ * RM_FreeString(str1);
+ * RM_FreeString(str2);
+ *
+ * If after the RM_HoldString we would just remove the string from
+ * the auto memory, this example will cause access to a freed memory
+ * on 'RM_FreeString(str2);' because the String will be free
+ * on 'RM_FreeString(str1);'.
+ *
+ * So it's safer to just increase the ref count
+ * and add the String to auto memory again.
+ *
+ * The limitation is that it is not possible to use RedisModule_StringAppendBuffer
+ * on the String.
*/
autoMemoryAdd(ctx,REDISMODULE_AM_STRING,str);
}
diff --git a/src/networking.c b/src/networking.c
index bc5d8128f..954de341e 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -575,8 +575,8 @@ void addReplyErrorObject(client *c, robj *err) {
}
/* Sends either a reply or an error reply by checking the first char.
- * If the first char is '-' the reply is considered an error.
- * In any case the given reply is sent, if the reply is also recognize
+ * If the first char is '-' the reply is considered an error.
+ * In any case the given reply is sent, if the reply is also recognize
* as an error we also perform some post reply operations such as
* logging and stats update. */
void addReplyOrErrorObject(client *c, robj *reply) {
diff --git a/src/replication.c b/src/replication.c
index 14f32a869..0e575111b 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -1764,16 +1764,16 @@ void replicationCreateMasterClient(connection *conn, int dbid) {
connSetReadHandler(server.master->conn, readQueryFromClient);
/**
-     * Important note:
-     * The CLIENT_DENY_BLOCKING flag is not, and should not, be set here.
-     * For commands like BLPOP, it makes no sense to block the master
-     * connection, and such blocking attempt will probably cause deadlock and
-     * break the replication. We consider such a thing as a bug because
-    * commands as BLPOP should never be sent on the replication link.
-     * A possible use-case for blocking the replication link is if a module wants
-     * to pass the execution to a background thread and unblock after the
-     * execution is done. This is the reason why we allow blocking the replication
-     * connection. */
+ * Important note:
+ * The CLIENT_DENY_BLOCKING flag is not, and should not, be set here.
+ * For commands like BLPOP, it makes no sense to block the master
+ * connection, and such blocking attempt will probably cause deadlock and
+ * break the replication. We consider such a thing as a bug because
+ * commands as BLPOP should never be sent on the replication link.
+ * A possible use-case for blocking the replication link is if a module wants
+ * to pass the execution to a background thread and unblock after the
+ * execution is done. This is the reason why we allow blocking the replication
+ * connection. */
server.master->flags |= CLIENT_MASTER;
server.master->authenticated = 1;
diff --git a/src/resp_parser.c b/src/resp_parser.c
index c9f5d0b00..b92a74cff 100644
--- a/src/resp_parser.c
+++ b/src/resp_parser.c
@@ -35,7 +35,7 @@
* callback represents a different reply type. Each callback gets a p_ctx that
* was given to the parseReply function. The callbacks also give the protocol
* (underlying blob) of the current reply and the size.
- *
+ *
* Some callbacks also get the parser object itself:
* - array_callback
* - set_callback
diff --git a/src/script_lua.c b/src/script_lua.c
index cf0755e15..8cdd80523 100644
--- a/src/script_lua.c
+++ b/src/script_lua.c
@@ -1562,8 +1562,8 @@ static void luaMaskCountHook(lua_State *lua, lua_Debug *ar) {
/*
* Set the hook to invoke all the time so the user
-         * will not be able to catch the error with pcall and invoke
-         * pcall again which will prevent the script from ever been killed
+ * will not be able to catch the error with pcall and invoke
+ * pcall again which will prevent the script from ever been killed
*/
lua_sethook(lua, luaMaskCountHook, LUA_MASKLINE, 0);