D-Bus
1.14.10
dbus
dbus-server-socket.c
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2
/* dbus-server-socket.c Server implementation for sockets
3
*
4
* Copyright (C) 2002, 2003, 2004, 2006 Red Hat Inc.
5
*
6
* Licensed under the Academic Free License version 2.1
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*
22
*/
23
24
#include <config.h>
25
#include "dbus-internals.h"
26
#include "dbus-server-socket.h"
27
#include "dbus-transport-socket.h"
28
#include "dbus-connection-internal.h"
29
#include "dbus-memory.h"
30
#include "dbus-nonce.h"
31
#include "dbus-string.h"
32
44
typedef
struct
DBusServerSocket
DBusServerSocket
;
45
50
struct
DBusServerSocket
51
{
52
DBusServer
base
;
53
int
n_fds
;
54
DBusSocket
*
fds
;
55
DBusWatch
**
watch
;
56
char
*
socket_name
;
57
DBusNonceFile
*
noncefile
;
58
};
59
60
static
void
61
socket_finalize (
DBusServer
*server)
62
{
63
DBusServerSocket
*socket_server = (
DBusServerSocket
*) server;
64
int
i;
65
66
_dbus_server_finalize_base
(server);
67
68
for
(i = 0 ; i < socket_server->
n_fds
; i++)
69
if
(socket_server->
watch
[i])
70
{
71
_dbus_watch_unref
(socket_server->