deprecate misnamed lws_vhost_get add lws_get_vhost
All the other simple accessors begin lws_get_... Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
3dcbf6abc1
commit
81a5a125f4
5 changed files with 19 additions and 9 deletions
|
@ -777,6 +777,12 @@ lws_vhost_get(struct lws *wsi)
|
|||
return wsi->vhost;
|
||||
}
|
||||
|
||||
LWS_VISIBLE struct lws_vhost *
|
||||
lws_get_vhost(struct lws *wsi)
|
||||
{
|
||||
return wsi->vhost;
|
||||
}
|
||||
|
||||
LWS_VISIBLE const struct lws_protocols *
|
||||
lws_protocol_get(struct lws *wsi)
|
||||
{
|
||||
|
|
|
@ -1641,8 +1641,12 @@ LWS_VISIBLE LWS_EXTERN int
|
|||
lws_init_vhost_client_ssl(const struct lws_context_creation_info *info,
|
||||
struct lws_vhost *vhost);
|
||||
|
||||
/* deprecated: use lws_get_vhost() */
|
||||
LWS_VISIBLE LWS_EXTERN struct lws_vhost *
|
||||
lws_vhost_get(struct lws *wsi);
|
||||
lws_vhost_get(struct lws *wsi) LWS_WARN_DEPRECATED;
|
||||
|
||||
LWS_VISIBLE LWS_EXTERN struct lws_vhost *
|
||||
lws_get_vhost(struct lws *wsi);
|
||||
|
||||
/* deprecated: use lws_get_protocol */
|
||||
LWS_VISIBLE LWS_EXTERN const struct lws_protocols *
|
||||
|
|
|
@ -55,7 +55,7 @@ callback_dumb_increment(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
(struct per_session_data__dumb_increment *)user;
|
||||
struct per_vhost_data__dumb_increment *vhd =
|
||||
(struct per_vhost_data__dumb_increment *)
|
||||
lws_protocol_vh_priv_get(lws_vhost_get(wsi),
|
||||
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
||||
lws_get_protocol(wsi));
|
||||
unsigned char buf[LWS_PRE + 512];
|
||||
unsigned char *p = &buf[LWS_PRE];
|
||||
|
@ -63,12 +63,12 @@ callback_dumb_increment(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
|
||||
switch (reason) {
|
||||
case LWS_CALLBACK_PROTOCOL_INIT:
|
||||
vhd = lws_protocol_vh_priv_zalloc(lws_vhost_get(wsi),
|
||||
vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
|
||||
lws_get_protocol(wsi),
|
||||
sizeof(struct per_vhost_data__dumb_increment));
|
||||
vhd->context = lws_get_context(wsi);
|
||||
vhd->protocol = lws_get_protocol(wsi);
|
||||
vhd->vhost = lws_vhost_get(wsi);
|
||||
vhd->vhost = lws_get_vhost(wsi);
|
||||
uv_timer_init(lws_uv_getloop(vhd->context, 0),
|
||||
&vhd->timeout_watcher);
|
||||
uv_timer_start(&vhd->timeout_watcher,
|
||||
|
|
|
@ -51,7 +51,7 @@ callback_dumb_increment(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
(struct per_session_data__dumb_increment *)user;
|
||||
struct per_vhost_data__dumb_increment *vhd =
|
||||
(struct per_vhost_data__dumb_increment *)
|
||||
lws_protocol_vh_priv_get(lws_vhost_get(wsi),
|
||||
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
||||
lws_get_protocol(wsi));
|
||||
unsigned char buf[LWS_PRE + 512];
|
||||
unsigned char *p = &buf[LWS_PRE];
|
||||
|
@ -59,12 +59,12 @@ callback_dumb_increment(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
|
||||
switch (reason) {
|
||||
case LWS_CALLBACK_PROTOCOL_INIT:
|
||||
vhd = lws_protocol_vh_priv_zalloc(lws_vhost_get(wsi),
|
||||
vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
|
||||
lws_get_protocol(wsi),
|
||||
sizeof(struct per_vhost_data__dumb_increment));
|
||||
vhd->context = lws_get_context(wsi);
|
||||
vhd->protocol = lws_get_protocol(wsi);
|
||||
vhd->vhost = lws_vhost_get(wsi);
|
||||
vhd->vhost = lws_get_vhost(wsi);
|
||||
uv_timer_init(lws_uv_getloop(vhd->context, 0),
|
||||
&vhd->timeout_watcher);
|
||||
uv_timer_start(&vhd->timeout_watcher,
|
||||
|
|
|
@ -48,7 +48,7 @@ callback_lws_mirror(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
(struct per_session_data__lws_mirror *)user;
|
||||
struct per_vhost_data__lws_mirror *v =
|
||||
(struct per_vhost_data__lws_mirror *)
|
||||
lws_protocol_vh_priv_get(lws_vhost_get(wsi),
|
||||
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
||||
lws_get_protocol(wsi));
|
||||
int n, m;
|
||||
|
||||
|
@ -61,7 +61,7 @@ callback_lws_mirror(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
break;
|
||||
|
||||
case LWS_CALLBACK_PROTOCOL_INIT: /* per vhost */
|
||||
lws_protocol_vh_priv_zalloc(lws_vhost_get(wsi),
|
||||
lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
|
||||
lws_get_protocol(wsi),
|
||||
sizeof(struct per_vhost_data__lws_mirror));
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue