cl->peername = mystrdup(client_addr);
if (!cl->peername) abort();
cl->peerport = port;
- if (cctx || !strcmp(cl->peername, "127.0.0.1"))
+ if (cctx)
cl->umode |= UMODE_SECURE;
extern const char *hostname;
- cl->hostname = mystrdup(!strcmp(cl->peername, "127.0.0.1") ? "localhost" : hostname);
+ if (!strcmp(cl->peername, "127.0.0.1")) {
+ cl->hostname = mystrdup("localhost");
+ cl->umode |= UMODE_SECURE;
+ } else if (!strcmp(cl->peername, "127.0.0.2")) {
+ cl->hostname = mystrdup("onion");
+ cl->umode |= UMODE_SECURE;
+ } else {
+ cl->hostname = mystrdup(hostname);
+ }
if (!cl->hostname)
abort();
net_poll_add(cl->FD, SOCKTYPE_CLIENT, cl);