Introduction
Introduction Statistics Contact Development Disclaimer Help
rename "server" to "host", because this name is used in the RFC - gopher-valida…
git clone git://git.codemadness.org/gopher-validator
Log
Files
Refs
README
LICENSE
---
commit a19073d4e019f0a18d854ca2ff1df7d6132d563a
parent 512e7771a14a5b12fcbd24d96497fcf5cc999722
Author: Hiltjo Posthuma <[email protected]>
Date: Thu, 9 Jan 2020 20:13:21 +0100
rename "server" to "host", because this name is used in the RFC
Diffstat:
M gopher-validator.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/gopher-validator.c b/gopher-validator.c
@@ -31,7 +31,7 @@ struct visited {
int _type;
char username[1024];
char path[1024];
- char server[256];
+ char host[256];
char port[8];
};
@@ -130,7 +130,7 @@ warning(const char *fmt, ...)
}
int
-isvalidserver(const char *s)
+isvalidhost(const char *s)
{
int colons;
@@ -280,13 +280,13 @@ checkdir(FILE *fp)
continue;
}
- /* server */
+ /* host */
len = strcspn(line + i, "\t");
- if (len + 1 < sizeof(v.server)) {
- memcpy(v.server, line + i, len);
- v.server[len] = '\0';
+ if (len + 1 < sizeof(v.host)) {
+ memcpy(v.host, line + i, len);
+ v.host[len] = '\0';
} else {
- error("%zu: server field too long\n", linenr);
+ error("%zu: host field too long\n", linenr);
continue;
}
if (line[i + len] == '\t') {
@@ -347,8 +347,8 @@ checkdir(FILE *fp)
}
}
- if (!isvalidserver(v.server))
- error("%zu: invalid server: %s\n", linenr, v.server);
+ if (!isvalidhost(v.host))
+ error("%zu: invalid host: %s\n", linenr, v.host);
/* check port, must be numeric and in range, port 0 is allowed:
"Appendix:
@@ -420,12 +420,12 @@ checkdir(FILE *fp)
}
void
-checkremote(const char *server, const char *port, const char *path, const char…
+checkremote(const char *host, const char *port, const char *path, const char *…
{
FILE *fp;
int fd, r;
- fd = edial(server, port);
+ fd = edial(host, port);
if (param[0])
r = dprintf(fd, "%s\t%s\r\n", path, param);
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.