return vhost->protocol_vh_privs[n];
}
-static struct lws_protocol_vhost_options *
+static const struct lws_protocol_vhost_options *
lws_vhost_protocol_options(struct lws_vhost *vh, const char *name)
{
- struct lws_protocol_vhost_options *pvo = vh->pvo;
+ const struct lws_protocol_vhost_options *pvo = vh->pvo;
while (pvo) {
// lwsl_notice("%s: '%s' '%s'\n", __func__, pvo->name, name);
lws_protocol_init(struct lws_context *context)
{
struct lws_vhost *vh = context->vhost_list;
- struct lws_protocol_vhost_options *pvo;
+ const struct lws_protocol_vhost_options *pvo;
struct lws wsi;
int n;
* protocol ptrs so lws_get_context(wsi) etc can work
*/
vh->protocols[n].callback(&wsi,
- LWS_CALLBACK_PROTOCOL_INIT, NULL, pvo, 0);
+ LWS_CALLBACK_PROTOCOL_INIT, NULL,
+ (void *)pvo, 0);
}
vh = vh->vhost_next;
LWS_VISIBLE LWS_EXTERN int
lws_cgi(struct lws *wsi, const char * const *exec_array, int script_uri_path_len,
- int timeout_secs, struct lws_protocol_vhost_options *mp_cgienv)
+ int timeout_secs, const struct lws_protocol_vhost_options *mp_cgienv)
{
struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi];
char *env_array[30], cgi_path[400], e[1024], *p = e,
const char *opt_name, const char *opt_val);
struct lws_protocol_vhost_options {
- struct lws_protocol_vhost_options *next;
- struct lws_protocol_vhost_options *options;
+ const struct lws_protocol_vhost_options *next;
+ const struct lws_protocol_vhost_options *options;
const char *name;
const char *value;
};
const char *origin; /* path to be mounted, eg, "/var/www/warmcat.com" */
const char *def; /* default target, eg, "index.html" */
- struct lws_protocol_vhost_options *cgienv;
+ const struct lws_protocol_vhost_options *cgienv;
int cgi_timeout;
int cache_max_age;
const char *ecdh_curve; /* VH */
const char *vhost_name; /* VH */
const char *plugins_dir; /* context */
- struct lws_protocol_vhost_options *pvo; /* VH */
+ const struct lws_protocol_vhost_options *pvo; /* VH */
int keepalive_timeout; /* VH */
const char *log_filepath; /* VH */
const struct lws_http_mount *mounts; /* VH */
LWS_VISIBLE LWS_EXTERN int
lws_cgi(struct lws *wsi, const char * const *exec_array,
int script_uri_path_len, int timeout_secs,
- struct lws_protocol_vhost_options *mp_cgienv);
+ const struct lws_protocol_vhost_options *mp_cgienv);
LWS_VISIBLE LWS_EXTERN int
lws_cgi_write_split_stdout_headers(struct lws *wsi);
const char *iface;
const struct lws_protocols *protocols;
void **protocol_vh_privs;
- struct lws_protocol_vhost_options *pvo;
+ const struct lws_protocol_vhost_options *pvo;
struct lws **same_vh_protocol_list;
#ifdef LWS_OPENSSL_SUPPORT
SSL_CTX *ssl_ctx;
callback_lws_server_status(struct lws *wsi, enum lws_callback_reasons reason,
void *user, void *in, size_t len)
{
- struct lws_protocol_vhost_options *pvo =
- (struct lws_protocol_vhost_options *)in;
+ const struct lws_protocol_vhost_options *pvo =
+ (const struct lws_protocol_vhost_options *)in;
int m, period = 1000;
switch (reason) {