Delete client.h/.c
This commit is contained in:
@ -208,3 +208,16 @@ int config_load(const char *filename) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
host_config_t *get_host_config(const char *host) {
|
||||
for (int i = 0; i < CONFIG_MAX_HOST_CONFIG; i++) {
|
||||
host_config_t *hc = &config.hosts[i];
|
||||
if (hc->type == CONFIG_TYPE_UNSET) break;
|
||||
if (strcmp(hc->name, host) == 0) return hc;
|
||||
if (hc->name[0] == '*' && hc->name[1] == '.') {
|
||||
const char *pos = strstr(host, hc->name + 1);
|
||||
if (pos != NULL && strlen(pos) == strlen(hc->name + 1)) return hc;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -60,4 +60,6 @@ extern config_t config;
|
||||
|
||||
int config_load(const char *filename);
|
||||
|
||||
host_config_t *get_host_config(const char *host);
|
||||
|
||||
#endif //SESIMOS_CONFIG_H
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "include/fastcgi.h"
|
||||
#include "http.h"
|
||||
#include "uri.h"
|
||||
#include "../client.h"
|
||||
#include "../server.h"
|
||||
|
||||
#define FASTCGI_CHUNKED 1
|
||||
#define FASTCGI_COMPRESS_GZ 2
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "http.h"
|
||||
#include "config.h"
|
||||
#include "../client.h"
|
||||
#include "../server.h"
|
||||
|
||||
extern sock proxy;
|
||||
|
||||
|
Reference in New Issue
Block a user