Emit an item in Gopher directory listing format: * * If descr or selector are NULL, then the "(NULL)" string is used instead. */
| 33 | * <type><descr><TAB><selector><TAB><hostname><TAB><port> |
| 34 | * If descr or selector are NULL, then the "(NULL)" string is used instead. */ |
| 35 | void 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 |
no test coverage detected