MCPcopy Create free account
hub / github.com/F-Stack/f-stack / addReplyGopherItem

Function addReplyGopherItem

app/redis-6.2.6/src/gopher.c:35–45  ·  view source on GitHub ↗

Emit an item in Gopher directory listing format: * * If descr or selector are NULL, then the "(NULL)" string is used instead. */

Source from the content-addressed store, hash-verified

33 * <type><descr><TAB><selector><TAB><hostname><TAB><port>
34 * If descr or selector are NULL, then the "(NULL)" string is used instead. */
35void addReplyGopherItem(client *c, const char *type, const char *descr,
36 const char *selector, const char *hostname, int port)
37{
38 sds item = sdscatfmt(sdsempty(),"%s%s\t%s\t%s\t%i\r\n",
39 type, descr,
40 selector ? selector : "(NULL)",
41 hostname ? hostname : "(NULL)",
42 port);
43 addReplyProto(c,item,sdslen(item));
44 sdsfree(item);
45}
46
47/* This is called by processInputBuffer() when an inline request is processed
48 * with Gopher mode enabled, and the request happens to have zero or just one

Callers 1

processGopherRequestFunction · 0.85

Calls 5

sdscatfmtFunction · 0.85
sdsemptyFunction · 0.85
addReplyProtoFunction · 0.85
sdslenFunction · 0.85
sdsfreeFunction · 0.85

Tested by

no test coverage detected