MSF_DBG("type:%s", this_ptr->eventType.c_str());
- if (lws_remaining_packet_payload(wsi) == 0) {
+ if (lws_is_final_fragment(wsi)) {
MSF_DBG("there's no remaining packet");
if (this_ptr->eventType == CONNECT_EVENT) {
MSF_DBG("handle connect message");
this_ptr->connectionHandler->resetLastPingReceived();
- if (lws_remaining_packet_payload(wsi) == 0) {
+ if (lws_is_final_fragment(wsi)) {
MSF_DBG("there's no remaining packet");
if (this_ptr->eventType == CONNECT_EVENT) {
MSF_DBG("handle connect message");
this_ptr->connectionHandler->resetLastPingReceived();
}
- if (lws_remaining_packet_payload(wsi) == 0) {
+ if (lws_is_final_fragment(wsi)) {
if (this_ptr->cl_data) {
this_ptr->json_parse((char*)this_ptr->cl_data);
}
void Channel::create_websocket(void *att) {
struct lws_protocols protocols[] = {
- {NULL, Channel::callback_lws_mirror, sizeof(int), 0, 0,
+ {NULL, Channel::callback_lws_mirror, sizeof(int), 512000, 0,
NULL},
// libwebsockets 1.7 has a bug.
}
info.gid = -1;
info.uid = -1;
- info.options = 0;
+ info.options = (1 << 12);
info.user = this;
#ifndef LWS_NO_EXTENSIONS
MSF_ERR("wsi destroyed with no communication");
if (onErrorListener) {
- onErrorListener->onError();
+ onErrorListener->onError(Error::create("Closed"));
}
}
}