[mod_proxy] move data_fastcgi into mod_proxy.c
[lighttpd.git] / src / http_vhostdb.c
blobdb8871ce3899ee100e069f95e6603e087888488f
1 #include "first.h"
3 #include "http_vhostdb.h"
5 #include <string.h>
8 static http_vhostdb_backend_t http_vhostdb_backends[8];
10 void http_vhostdb_dumbdata_reset (void)
12 memset(http_vhostdb_backends, 0, sizeof(http_vhostdb_backends));
15 const http_vhostdb_backend_t * http_vhostdb_backend_get (const buffer *name)
17 int i = 0;
18 while (NULL != http_vhostdb_backends[i].name
19 && 0 != strcmp(http_vhostdb_backends[i].name, name->ptr)) {
20 ++i;
22 return (NULL != http_vhostdb_backends[i].name)
23 ? http_vhostdb_backends+i
24 : NULL;
27 void http_vhostdb_backend_set (const http_vhostdb_backend_t *backend)
29 unsigned int i = 0;
30 while (NULL != http_vhostdb_backends[i].name) ++i;
31 /*(must resize http_vhostdb_backends[] if too many different backends)*/
32 force_assert(
33 i < (sizeof(http_vhostdb_backends)/sizeof(http_vhostdb_backend_t))-1);
34 memcpy(http_vhostdb_backends+i, backend, sizeof(http_vhostdb_backend_t));