commit - 0d8ca45a28a97215c20fdc13c13f764cb571ad7c
commit + b55de916338eef77a509a3d698d0f3d98f079804
blob - 394dd9a50a3f2b4696417147fea60e967ba0105c
blob + e56cb0a43a67a8af6f59bab8dd7daa7c5bfbc6ec
--- gmid.c
+++ gmid.c
return S_ISDIR(sb.st_mode);
}
-void senddir(char*, struct tls*);
+void send_dir(char*, struct tls*);
void
-sendfile(char *path, struct tls *ctx)
+send_file(char *path, struct tls *ctx)
{
int fd;
char fpath[PATHBUF];
if (isdir(fd)) {
warnx("%s is a directory, trying %s/index.gmi", fpath, fpath);
close(fd);
- senddir(fpath, ctx);
+ send_dir(fpath, ctx);
return;
}
}
void
-senddir(char *path, struct tls *ctx)
+send_dir(char *path, struct tls *ctx)
{
char fpath[PATHBUF];
size_t len;
strlcat(fpath, "index.gmi", sizeof(fpath));
- sendfile(fpath, ctx);
+ send_file(fpath, ctx);
}
void
fprintf(stderr, "requested path: %s\n", path);
if (path_isdir(path))
- senddir(path, ctx);
+ send_dir(path, ctx);
else
- sendfile(path, ctx);
+ send_file(path, ctx);
}
int