コード例 #1
0
void shutdowndccchat(dccchat_t *chat, int flush)
{
  if (chat->status != DCCCHAT_UNUSED)
    {
      if (flush)
        {
          flushdccchat(chat);
        }
      
      usleep(100*1000);
      shutdown_close(chat->con.clientsocket);
      mydelete(chat->groups);
      mydelete(chat->hostmask);
      mydelete(chat->nick);
      mydelete(chat->con.localaddr);
      mydelete(chat->con.remoteaddr);
      ir_boutput_delete(&chat->boutput);

      if (chat->status == DCCCHAT_LISTENING)
        ir_listen_port_connected(chat->con.localport);

#ifdef USE_UPNP
      if (gdata.upnp_router && (chat->con.family == AF_INET))
        upnp_rem_redir(chat->con.localport);
#endif /* USE_UPNP */

      memset(chat, 0, sizeof(dccchat_t));
      chat->con.clientsocket = FD_UNUSED;
      chat->status = DCCCHAT_UNUSED;
      
      gdata.num_dccchats--;
    }
  return;
}
コード例 #2
0
void tostdout_disable_buffering(void)
{
  if (!gdata.stdout_buffer_init)
    {
      return;
    }
  
  set_socket_nonblocking(fileno(stdout),0);
  
  tostdout_write();
  
  ir_boutput_delete(&gdata.stdout_buffer);
  gdata.stdout_buffer_init = 0;
  
  return;
}