Skip to content

Commit

Permalink
droplet: allow pmd
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jul 8, 2024
1 parent 66cc879 commit 0cba308
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion droplet/playground/stress.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

const randInt = (lower, upper) => Math.floor(Math.random() * (upper - lower) + lower);
const randStr = (size) => {
const buffer = new Uint8Array(Math.random() * 100);
const buffer = new Uint8Array(Math.random() * 10000);
for (let i = 0; i < buffer.length; i++) {
buffer[i] = 48 + randInt(0, 9);
}
Expand Down
15 changes: 14 additions & 1 deletion droplet/src/droplet.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,23 @@ static const char* get_mount_origin(int argc, const char** argv)
return "./playground";
}

#ifndef LWS_WITHOUT_EXTENSIONS
static const struct lws_extension extensions[] = {
{ "permessage-deflate",
lws_extension_callback_pm_deflate,
"permessage-deflate" },
{ NULL, NULL, NULL /* terminator */ }
};
#endif

int main(int argc, const char** argv)
{
signal(SIGINT, sigint_handler);

username_init();

#ifndef NDEBUG
lws_set_log_level(LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE, NULL);
lws_set_log_level(LLL_ERR | LLL_WARN | LLL_NOTICE, NULL);
#else
lws_set_log_level(LLL_ERR | LLL_WARN, NULL);
#endif
Expand All @@ -62,6 +71,10 @@ int main(int argc, const char** argv)
info.mounts = &mount;
info.protocols = protocols;

#ifndef LWS_WITHOUT_EXTENSIONS
info.extensions = extensions;
#endif

info.ka_time = 120;
info.ka_probes = 30;
info.ka_interval = 4;
Expand Down

0 comments on commit 0cba308

Please sign in to comment.