Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
00cf82c0
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
00cf82c0
编写于
10月 15, 2010
作者:
P
Pieter Noordhuis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change tcl client to only use the multibulk protocol
上级
cd8788f2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
37 deletion
+7
-37
tests/support/redis.tcl
tests/support/redis.tcl
+7
-37
未找到文件。
tests/support/redis.tcl
浏览文件 @
00cf82c0
...
...
@@ -36,25 +36,6 @@ array set ::redis::deferred {}
array set ::redis::callback
{}
array set ::redis::state
{}
;
# State in non-blocking reply reading
array set ::redis::statestack
{}
;
# Stack of states, for nested mbulks
array set ::redis::bulkarg
{}
array set ::redis::multibulkarg
{}
# Flag commands requiring last argument as a bulk write operation
foreach redis_bulk_cmd
{
set setnx rpush lpush rpushx lpushx linsert lset lrem sadd srem sismember echo getset smove zadd zrem zscore zincrby append zrank zrevrank hget hdel hexists setex publish
}
{
set ::redis::bulkarg
(
$redis
_bulk_cmd
)
{}
}
# Flag commands requiring last argument as a bulk write operation
foreach redis_multibulk_cmd
{
mset msetnx hset hsetnx hmset hmget
}
{
set ::redis::multibulkarg
(
$redis
_multibulk_cmd
)
{}
}
unset redis_bulk_cmd
unset redis_multibulk_cmd
proc redis
{{
server 127.0.0.1
}
{
port 6379
}
{
defer 0
}}
{
set fd
[
socket $server $port
]
...
...
@@ -79,25 +60,14 @@ proc ::redis::__dispatch__ {id method args} {
set args
[
lrange $args 0 end-1
]
}
if
{[
info command ::redis::__method__$method
]
eq
{}}
{
if
{[
info exists ::redis::bulkarg
(
$method
)]}
{
set cmd
"
$method
"
append cmd
[
join
[
lrange $args 0 end-1
]]
append cmd
"
[
string length
[
lindex $args end
]]
\r\n
"
append cmd
[
lindex $args end
]
::redis::redis_writenl $fd $cmd
}
elseif
{[
info exists ::redis::multibulkarg
(
$method
)]}
{
set cmd
"*
[
expr
{[
llength $args
]
+1
}]
\r\n
"
append cmd
"
$
[
string length $method
]
\r\n
$method
\r\n
"
foreach a $args
{
append cmd
"
$
[
string length $a
]
\r\n
$a
\r\n
"
}
::redis::redis_write $fd $cmd
flush $fd
}
else
{
set cmd
"
$method
"
append cmd
[
join $args
]
::redis::redis_writenl $fd $cmd
set cmd
"*
[
expr
{[
llength $args
]
+1
}]
\r\n
"
append cmd
"
$
[
string length $method
]
\r\n
$method
\r\n
"
foreach a $args
{
append cmd
"
$
[
string length $a
]
\r\n
$a
\r\n
"
}
::redis::redis_write $fd $cmd
flush $fd
if
{
!$deferred
}
{
if
{
$blocking
}
{
::redis::redis_read_reply $fd
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录