Rename functions in data.h and adapt ifdef
Signed-off-by: Laslo Hunhold <dev@frign.de>
This commit is contained in:
parent
a94b15814c
commit
db127723c6
3 changed files with 9 additions and 12 deletions
4
data.c
4
data.c
|
@ -39,7 +39,7 @@ suffix(int t)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum status
|
enum status
|
||||||
resp_dir(int fd, const struct response *res)
|
data_send_dirlisting(int fd, const struct response *res)
|
||||||
{
|
{
|
||||||
enum status ret;
|
enum status ret;
|
||||||
struct dirent **e;
|
struct dirent **e;
|
||||||
|
@ -87,7 +87,7 @@ cleanup:
|
||||||
}
|
}
|
||||||
|
|
||||||
enum status
|
enum status
|
||||||
resp_file(int fd, const struct response *res)
|
data_send_file(int fd, const struct response *res)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
enum status ret = 0;
|
enum status ret = 0;
|
||||||
|
|
13
data.h
13
data.h
|
@ -1,13 +1,10 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
#ifndef RESP_H
|
#ifndef DATA_H
|
||||||
#define RESP_H
|
#define DATA_H
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
|
|
||||||
enum status resp_dir(int, const struct response *);
|
enum status data_send_dirlisting(int, const struct response *);
|
||||||
enum status resp_file(int, const struct response *);
|
enum status data_send_file(int, const struct response *);
|
||||||
|
|
||||||
#endif /* RESP_H */
|
#endif /* DATA_H */
|
||||||
|
|
4
main.c
4
main.c
|
@ -50,9 +50,9 @@ serve(int infd, const struct sockaddr_storage *in_sa, const struct server *srv)
|
||||||
} else {
|
} else {
|
||||||
/* send data */
|
/* send data */
|
||||||
if (c.res.type == RESTYPE_FILE) {
|
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) {
|
} else if (c.res.type == RESTYPE_DIRLISTING) {
|
||||||
resp_dir(c.fd, &c.res);
|
data_send_dirlisting(c.fd, &c.res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue