lighttpd 1.4.x
https://www.lighttpd.net/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
2 years ago
|
/*
|
||
1 year ago
|
* http_vhostdb_api - virtual hosts mapping backend registration
|
||
2 years ago
|
*
|
||
|
* Copyright(c) 2017 Glenn Strauss gstrauss()gluelogic.com All rights reserved
|
||
|
* License: BSD 3-clause (same as lighttpd)
|
||
|
*/
|
||
6 years ago
|
#include "first.h"
|
||
|
|
||
1 year ago
|
#include "mod_vhostdb_api.h"
|
||
6 years ago
|
|
||
|
#include <string.h>
|
||
|
|
||
|
|
||
|
static http_vhostdb_backend_t http_vhostdb_backends[8];
|
||
|
|
||
6 years ago
|
void http_vhostdb_dumbdata_reset (void)
|
||
|
{
|
||
|
memset(http_vhostdb_backends, 0, sizeof(http_vhostdb_backends));
|
||
|
}
|
||
|
|
||
6 years ago
|
const http_vhostdb_backend_t * http_vhostdb_backend_get (const buffer *name)
|
||
|
{
|
||
|
int i = 0;
|
||
|
while (NULL != http_vhostdb_backends[i].name
|
||
|
&& 0 != strcmp(http_vhostdb_backends[i].name, name->ptr)) {
|
||
|
++i;
|
||
|
}
|
||
|
return (NULL != http_vhostdb_backends[i].name)
|
||
|
? http_vhostdb_backends+i
|
||
|
: NULL;
|
||
|
}
|
||
|
|
||
|
void http_vhostdb_backend_set (const http_vhostdb_backend_t *backend)
|
||
|
{
|
||
|
unsigned int i = 0;
|
||
|
while (NULL != http_vhostdb_backends[i].name) ++i;
|
||
|
/*(must resize http_vhostdb_backends[] if too many different backends)*/
|
||
|
force_assert(
|
||
|
i < (sizeof(http_vhostdb_backends)/sizeof(http_vhostdb_backend_t))-1);
|
||
|
memcpy(http_vhostdb_backends+i, backend, sizeof(http_vhostdb_backend_t));
|
||
|
}
|