pd->recv.done, pd->recv.needed,
pd->recv.current.used_len, pd->recv.current.total_len,
eina_error_msg_get(err));
+ efl_ref(o);
+ efl_io_closer_close(pd->http);
efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err);
+ efl_unref(o);
}
static void
{
Eo *o = data;
Efl_Net_Dialer_Websocket_Data *pd = efl_data_scope_get(o, MY_CLASS);
+ efl_ref(o);
if (!pd->close_requested)
{
Efl_Net_Dialer_Websocket_Closed_Reason reason = {
pd->close_requested = EINA_TRUE;
efl_event_callback_call(o, EFL_NET_DIALER_WEBSOCKET_EVENT_CLOSED_REASON, &reason);
}
+ if ((!pd->recv.pending_read) &&
+ (pd->streaming_mode != EFL_NET_DIALER_WEBSOCKET_STREAMING_MODE_DISABLED))
+ efl_event_callback_call(o, EFL_IO_READER_EVENT_EOS, NULL);
efl_event_callback_call(o, EFL_IO_CLOSER_EVENT_CLOSED, NULL);
+ efl_unref(o);
}
static void
Eina_Error *perr = event->info;
if ((pd->close_requested) && (*perr == EFL_NET_HTTP_ERROR_RECV_ERROR))
return;
+ efl_ref(o);
+ if (!efl_io_closer_closed_get(o)) efl_io_closer_close(o);
efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, perr);
+ efl_unref(o);
}
static void
return;
WRN("failed WebSocket handshake: HTTP status=%d, expected=%d",
status, EFL_NET_HTTP_STATUS_SWITCHING_PROTOCOLS);
+ efl_ref(o);
+ efl_io_closer_close(pd->http);
efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err);
+ efl_unref(o);
return;
}
Eina_Error err = EFL_NET_DIALER_ERROR_COULDNT_CONNECT;
WRN("failed WebSocket handshake: upgraded=%d, connection_websocket=%d, accepted=%d",
upgraded, connection_websocket, accepted);
+ efl_ref(o);
+ efl_io_closer_close(pd->http);
efl_event_callback_call(o, EFL_NET_DIALER_EVENT_ERROR, &err);
+ efl_unref(o);
return;
}