- if (cfg.proxy_telnet_command[eo] == '%') {
- sk_write(p->sub_socket, "%", 1);
- eo++;
- }
- else if (strnicmp(cfg.proxy_telnet_command + eo,
- "host", 4) == 0) {
- char dest[512];
- sk_getaddr(p->remote_addr, dest, lenof(dest));
- sk_write(p->sub_socket, dest, strlen(dest));
- eo += 4;
- }
- else if (strnicmp(cfg.proxy_telnet_command + eo,
- "port", 4) == 0) {
- char port[8];
- sprintf(port, "%i", p->remote_port);
- sk_write(p->sub_socket, port, strlen(port));
- eo += 4;
- }
- else if (strnicmp(cfg.proxy_telnet_command + eo,
- "user", 4) == 0) {
- sk_write(p->sub_socket, cfg.proxy_username,
- strlen(cfg.proxy_username));
- eo += 4;
- }
- else if (strnicmp(cfg.proxy_telnet_command + eo,
- "pass", 4) == 0) {
- sk_write(p->sub_socket, cfg.proxy_password,
- strlen(cfg.proxy_password));
- eo += 4;
- }
- else {
- /* we don't escape this, so send the % now, and
- * don't advance eo, so that we'll consider the
- * text immediately following the % as unescaped.
- */
- sk_write(p->sub_socket, "%", 1);
- }