Rename functions in data.h and adapt ifdef

Signed-off-by: Laslo Hunhold <dev@frign.de>
This commit is contained in:
Laslo Hunhold 2020-08-28 23:46:12 +02:00
parent a94b15814c
commit db127723c6
No known key found for this signature in database
GPG key ID: 69576BD24CFCB980
3 changed files with 9 additions and 12 deletions

4
data.c
View file

@ -39,7 +39,7 @@ suffix(int t)
}
enum status
resp_dir(int fd, const struct response *res)
data_send_dirlisting(int fd, const struct response *res)
{
enum status ret;
struct dirent **e;
@ -87,7 +87,7 @@ cleanup:
}
enum status
resp_file(int fd, const struct response *res)
data_send_file(int fd, const struct response *res)
{
FILE *fp;
enum status ret = 0;

13
data.h
View file

@ -1,13 +1,10 @@
/* See LICENSE file for copyright and license details. */
#ifndef RESP_H
#define RESP_H
#include <sys/stat.h>
#include <sys/types.h>
#ifndef DATA_H
#define DATA_H
#include "http.h"
enum status resp_dir(int, const struct response *);
enum status resp_file(int, const struct response *);
enum status data_send_dirlisting(int, const struct response *);
enum status data_send_file(int, const struct response *);
#endif /* RESP_H */
#endif /* DATA_H */

4
main.c
View file

@ -50,9 +50,9 @@ serve(int infd, const struct sockaddr_storage *in_sa, const struct server *srv)
} else {
/* send data */
if (c.res.type == RESTYPE_FILE) {
resp_file(c.fd, &c.res);
data_send_file(c.fd, &c.res);
} else if (c.res.type == RESTYPE_DIRLISTING) {
resp_dir(c.fd, &c.res);
data_send_dirlisting(c.fd, &c.res);
}
}