Example #1
0
static void
dsk_ssl_stream_shutdown (DskSslStream *stream)
{
  if (stream->underlying_read)
    {
      dsk_hook_trap_free (stream->underlying_read);
      stream->underlying_read = NULL;
    }
  if (stream->underlying_write)
    {
      dsk_hook_trap_free (stream->underlying_write);
      stream->underlying_write = NULL;
    }
  if (stream->underlying_sink)
    {
      dsk_octet_sink_shutdown (stream->underlying_sink);
      stream->underlying_sink = NULL;
    }
  if (stream->underlying_source)
    {
      dsk_octet_source_shutdown (stream->underlying_source);
      stream->underlying_source = NULL;
    }
  if (stream->base_instance.sink)
    dsk_octet_sink_detach (stream->base_instance.sink);
  if (stream->base_instance.source)
    dsk_octet_source_detach (stream->base_instance.source);
  if (stream->ssl)
    {
      SSL_free (stream->ssl);
      stream->ssl = NULL;
    }
}
Example #2
0
static void
do_shutdown (DskWebsocket *websocket)
{
  websocket->is_shutdown = DSK_TRUE;
  if (websocket->read_trap)
    {
      dsk_hook_trap_destroy (websocket->read_trap);
      websocket->read_trap = NULL;
    }
  if (websocket->write_trap)
    {
      dsk_hook_trap_destroy (websocket->write_trap);
      websocket->write_trap = NULL;
    }
  if (websocket->source)
    {
      dsk_octet_source_shutdown (websocket->source);
      dsk_object_unref (websocket->source);
      websocket->source = NULL;
    }
  if (websocket->sink)
    {
      dsk_octet_sink_shutdown (websocket->sink);
      dsk_object_unref (websocket->sink);
      websocket->sink = NULL;
    }
}