Lines Matching refs:srv_conf

183 		    (srv->srv_conf.flags & SRVFLAG_LOCATION) ?
185 srv->srv_conf.name, srv->srv_conf.id,
188 memcpy(&s, &srv->srv_conf, sizeof(s));
193 if (srv->srv_conf.return_uri_len != 0) {
194 iov[c].iov_base = srv->srv_conf.return_uri;
195 iov[c++].iov_len = srv->srv_conf.return_uri_len;
199 (srv->srv_conf.flags & SRVFLAG_LOCATION) == 0) {
212 __func__, srv->srv_conf.name);
220 __func__, srv->srv_conf.name);
232 __func__, srv->srv_conf.name);
247 explicit_bzero(&srv->srv_conf.tls_ticket_key,
248 sizeof(srv->srv_conf.tls_ticket_key));
258 struct server_config *srv_conf = &srv->srv_conf;
267 label, srv_conf->name, srv_conf->id, ps->ps_title[PROC_SERVER],
271 tls.id = srv_conf->id;
289 "`%s'", __func__, srv_conf->name);
305 struct server_config *srv_conf, *iconf;
321 srv_conf = serverconfig_byid(id);
332 if (srv->srv_conf.id == id) {
333 srv_conf = &srv->srv_conf;
338 srv_conf = iconf;
349 TAILQ_INSERT_HEAD(&srv_conf->fcgiparams, fp, entry);
361 struct server_config *srv_conf = &srv->srv_conf;
367 srv_conf->name, srv_conf->id, ps->ps_title[PROC_SERVER],
370 if (TAILQ_EMPTY(&srv_conf->fcgiparams)) /* nothing to do */
373 TAILQ_FOREACH(fp, &srv_conf->fcgiparams, entry) {
381 iov[c].iov_base = &srv_conf->id; /* server config id */
382 iov[c++].iov_len = sizeof(srv_conf->id);
384 TAILQ_FOREACH(fp, &srv_conf->fcgiparams, entry) { /* push FCGI params */
390 "`%s'", __func__, srv_conf->name);
402 struct server_config *srv_conf = &srv->srv_conf;
404 if ((srv_conf->flags & SRVFLAG_TLS) == 0)
407 log_debug("%s: configuring tls for %s", __func__, srv_conf->name);
409 if (config_settls(env, srv, TLS_CFG_CA, "ca", srv_conf->tls_ca,
410 srv_conf->tls_ca_len) != 0)
413 if (config_settls(env, srv, TLS_CFG_CERT, "cert", srv_conf->tls_cert,
414 srv_conf->tls_cert_len) != 0)
417 if (config_settls(env, srv, TLS_CFG_CRL, "crl", srv_conf->tls_crl,
418 srv_conf->tls_crl_len) != 0)
421 if (config_settls(env, srv, TLS_CFG_KEY, "key", srv_conf->tls_key,
422 srv_conf->tls_key_len) != 0)
426 srv_conf->tls_ocsp_staple, srv_conf->tls_ocsp_staple_len) != 0)
433 config_getserver_auth(struct httpd *env, struct server_config *srv_conf)
438 (srv_conf->flags & SRVFLAG_AUTH) == 0)
441 if ((srv_conf->auth = auth_byid(env->sc_auth,
442 srv_conf->auth_id)) == NULL)
455 struct server_config *srv_conf, *parent;
460 if ((srv_conf = calloc(1, sizeof(*srv_conf))) == NULL)
463 IMSG_SIZE_CHECK(imsg, srv_conf);
464 memcpy(srv_conf, p, sizeof(*srv_conf));
465 s = sizeof(*srv_conf);
468 serverconfig_reset(srv_conf);
471 if (strcmp(parent->name, srv_conf->name) == 0)
475 parent = &srv->srv_conf;
477 if (config_getserver_auth(env, srv_conf) != 0)
484 if (srv_conf->return_uri_len != 0) {
485 if ((srv_conf->return_uri = get_data(p + s,
486 srv_conf->return_uri_len)) == NULL)
488 s += srv_conf->return_uri_len;
491 if (srv_conf->flags & SRVFLAG_LOCATION) {
494 if ((srv_conf->flags & f) == 0) {
495 srv_conf->flags |= parent->flags & f;
496 (void)strlcpy(srv_conf->index, parent->index,
497 sizeof(srv_conf->index));
501 if ((srv_conf->flags & f) == 0)
502 srv_conf->flags |= parent->flags & f;
505 if ((srv_conf->flags & f) == 0) {
506 srv_conf->flags |= parent->flags & f;
507 (void)strlcpy(srv_conf->root, parent->root,
508 sizeof(srv_conf->root));
512 if ((srv_conf->flags & f) == 0)
513 srv_conf->flags |= parent->flags & f;
516 if ((srv_conf->flags & f) == 0) {
517 srv_conf->flags |= parent->flags & f;
518 srv_conf->logformat = parent->logformat;
522 if ((srv_conf->flags & f) == 0)
523 srv_conf->flags |= parent->flags & f;
526 if ((srv_conf->flags & f) == 0) {
527 srv_conf->flags |= parent->flags & f;
528 srv_conf->auth = parent->auth;
529 srv_conf->auth_id = parent->auth_id;
530 (void)strlcpy(srv_conf->auth_realm,
532 sizeof(srv_conf->auth_realm));
536 srv_conf->flags |= parent->flags & f;
537 srv_conf->tls_flags = parent->tls_flags;
540 if ((srv_conf->flags & f) == 0) {
541 srv_conf->flags |= parent->flags & f;
542 (void)strlcpy(srv_conf->accesslog,
544 sizeof(srv_conf->accesslog));
548 if ((srv_conf->flags & f) == 0) {
549 srv_conf->flags |= parent->flags & f;
550 (void)strlcpy(srv_conf->errorlog,
552 sizeof(srv_conf->errorlog));
556 if ((srv_conf->flags & f) == 0) {
557 free(srv_conf->return_uri);
558 srv_conf->flags |= parent->flags & f;
559 srv_conf->return_code = parent->return_code;
560 srv_conf->return_uri_len = parent->return_uri_len;
561 if (srv_conf->return_uri_len &&
562 (srv_conf->return_uri =
568 if ((srv_conf->flags & f) == 0) {
569 srv_conf->flags |= parent->flags & f;
570 memcpy(&srv_conf->default_type,
575 if ((srv_conf->flags & f) == 0) {
576 srv_conf->flags |= parent->flags & f;
577 (void)strlcpy(srv_conf->path, parent->path,
578 sizeof(srv_conf->path));
582 srv_conf->flags |= parent->flags & f;
583 srv_conf->hsts_max_age = parent->hsts_max_age;
584 srv_conf->hsts_flags = parent->hsts_flags;
586 memcpy(&srv_conf->timeout, &parent->timeout,
587 sizeof(srv_conf->timeout));
588 srv_conf->maxrequests = parent->maxrequests;
589 srv_conf->maxrequestbody = parent->maxrequestbody;
591 srv_conf->flags |= parent->flags & SRVFLAG_ERRDOCS;
592 (void)strlcpy(srv_conf->errdocroot, parent->errdocroot,
593 sizeof(srv_conf->errdocroot));
598 srv_conf->location, parent->name, parent->id,
599 printb_flags(srv_conf->flags, SRVFLAG_BITS));
605 srv_conf->name, srv_conf->id, parent->name, parent->id,
606 printb_flags(srv_conf->flags, SRVFLAG_BITS));
609 TAILQ_INSERT_TAIL(&srv->srv_hosts, srv_conf, entry);
614 serverconfig_free(srv_conf);
615 free(srv_conf);
626 struct server_config srv_conf;
631 IMSG_SIZE_CHECK(imsg, &srv_conf);
632 memcpy(&srv_conf, p, sizeof(srv_conf));
633 s = sizeof(srv_conf);
636 serverconfig_reset(&srv_conf);
640 if ((IMSG_DATA_SIZE(imsg) - s) < (size_t)srv_conf.return_uri_len) {
647 &srv_conf.ss, srv_conf.port)) != NULL) {
658 if (srv_conf.flags & SRVFLAG_LOCATION)
665 memcpy(&srv->srv_conf, &srv_conf, sizeof(srv->srv_conf));
668 if (config_getserver_auth(env, &srv->srv_conf) != 0)
677 if (srv->srv_conf.return_uri_len != 0) {
678 if ((srv->srv_conf.return_uri = get_data(p + s,
679 srv->srv_conf.return_uri_len)) == NULL)
683 TAILQ_INSERT_TAIL(&srv->srv_hosts, &srv->srv_conf, entry);
688 srv->srv_conf.name, srv->srv_conf.id,
689 printb_flags(srv->srv_conf.flags, SRVFLAG_BITS));
697 serverconfig_free(&srv->srv_conf);
704 config_gettls(struct httpd *env, struct server_config *srv_conf,
714 tls_conf->tls_len, len, tls_conf->tls_chunk_offset, srv_conf->name,
715 srv_conf->id);
752 struct server_config *srv_conf = NULL;
769 if ((srv_conf = serverconfig_byid(tls_conf.id)) == NULL) {
776 if (config_gettls(env, srv_conf, &tls_conf, "ca", p, len,
777 &srv_conf->tls_ca, &srv_conf->tls_ca_len) != 0)
782 if (config_gettls(env, srv_conf, &tls_conf, "cert", p, len,
783 &srv_conf->tls_cert, &srv_conf->tls_cert_len) != 0)
788 if (config_gettls(env, srv_conf, &tls_conf, "crl", p, len,
789 &srv_conf->tls_crl, &srv_conf->tls_crl_len) != 0)
794 if (config_gettls(env, srv_conf, &tls_conf, "key", p, len,
795 &srv_conf->tls_key, &srv_conf->tls_key_len) != 0)
800 if (config_gettls(env, srv_conf, &tls_conf, "ocsp staple",
801 p, len, &srv_conf->tls_ocsp_staple,
802 &srv_conf->tls_ocsp_staple_len) != 0)