Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f94d711c
Commit
f94d711c
authored
Feb 22, 2019
by
antirez
Browse files
Gopher: basic serving of string type.
parent
e00b22e0
Changes
1
Show whitespace changes
Inline
Side-by-side
src/gopher.c
View file @
f94d711c
...
...
@@ -49,7 +49,7 @@ void addReplyGopherItem(client *c, const char *type, const char *descr,
* argument. In such case we get the relevant key and reply using the Gopher
* protocol. */
void
processGopherRequest
(
client
*
c
)
{
robj
*
keyname
=
c
->
argc
==
0
?
createStringObject
(
"/"
,
1
)
:
c
->
argv
[
1
];
robj
*
keyname
=
c
->
argc
==
0
?
createStringObject
(
"/"
,
1
)
:
c
->
argv
[
0
];
robj
*
o
=
lookupKeyRead
(
c
->
db
,
keyname
);
/* If there is no such key, return with a Gopher error. */
...
...
@@ -63,6 +63,7 @@ void processGopherRequest(client *c) {
addReplyGopherItem
(
c
,
"i"
,
errstr
,
NULL
,
NULL
,
0
);
addReplyGopherItem
(
c
,
"i"
,
"Redis Gopher server"
,
NULL
,
NULL
,
0
);
}
else
{
addReply
(
c
,
o
);
}
/* Cleanup, also make sure to emit the final ".CRLF" line. Note that
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment