Skip to content

Commit

Permalink
esp32: allow return of default vhost at init time
Browse files Browse the repository at this point in the history
  • Loading branch information
lws-team committed Aug 5, 2017
1 parent 93a5b58 commit 219a367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/libwebsockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ struct lws_esp32_image {
};

extern struct lws_esp32 lws_esp32;
struct lws_vhost;

extern esp_err_t
lws_esp32_event_passthru(void *ctx, system_event_t *event);
Expand All @@ -649,7 +650,7 @@ struct lws_context_creation_info;
extern void
lws_esp32_set_creation_defaults(struct lws_context_creation_info *info);
extern struct lws_context *
lws_esp32_init(struct lws_context_creation_info *);
lws_esp32_init(struct lws_context_creation_info *, struct lws_vhost **pvh);
extern int
lws_esp32_wlan_nvs_get(int retry);
extern esp_err_t
Expand Down
5 changes: 4 additions & 1 deletion lib/lws-plat-esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ lws_esp32_get_image_info(const esp_partition_t *part, struct lws_esp32_image *i,
}

struct lws_context *
lws_esp32_init(struct lws_context_creation_info *info)
lws_esp32_init(struct lws_context_creation_info *info, struct lws_vhost **pvh)
{
const esp_partition_t *part = lws_esp_ota_get_boot_partition();
struct lws_context *context;
Expand Down Expand Up @@ -1683,6 +1683,9 @@ lws_esp32_init(struct lws_context_creation_info *info)
else
lws_init_vhost_client_ssl(info, vhost);

if (pvh)
*pvh = vhost;

lws_protocol_init(context);

return context;
Expand Down

0 comments on commit 219a367

Please sign in to comment.