index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
dir_000004.html
dbus
dbus-server.c
00001
/* -*- mode: C; c-file-style: "gnu" -*- */
00002
/* dbus-server.c DBusServer object
00003
*
00004
* Copyright (C) 2002, 2003, 2004, 2005 Red Hat Inc.
00005
*
00006
* Licensed under the Academic Free License version 2.1
00007
*
00008
* This program is free software; you can redistribute it and/or modify
00009
* it under the terms of the GNU General Public License as published by
00010
* the Free Software Foundation; either version 2 of the License, or
00011
* (at your option) any later version.
00012
*
00013
* This program is distributed in the hope that it will be useful,
00014
* but WITHOUT ANY WARRANTY; without even the implied warranty of
00015
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016
* GNU General Public License for more details.
00017
*
00018
* You should have received a copy of the GNU General Public License
00019
* along with this program; if not, write to the Free Software
00020
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021
*
00022
*/
00023
00024
#include "dbus-server.h"
00025
#include "dbus-server-unix.h"
00026
#include "dbus-string.h"
00027
#ifdef DBUS_BUILD_TESTS
00028
#include "dbus-server-debug-pipe.h"
00029
#endif
00030
#include "dbus-address.h"
00031
#include "dbus-protocol.h"
00032
00055
static
void
00056 init_guid (
unionDBusGUID.html
DBusGUID
*guid)
00057 {
00058
long
now;
00059
char
*p;
00060
int
ts_size;
00061
00062
group__DBusInternalsUtils.html#ga84
_dbus_get_current_time
(&now,
group__DBusMacros.html#ga4
NULL
);
00063
00064   guid->
unionDBusGUID.html#o0
as_uint32s
[0] = now;
00065
00066   ts_size =
sizeof
(guid->
unionDBusGUID.html#o0
as_uint32s
[0]);
00067   p = ((
char
*)guid->
unionDBusGUID.html#o1
as_bytes
) + ts_size;
00068
00069
group__DBusInternalsUtils.html#ga93
_dbus_generate_random_bytes_buffer
(p,
00070
sizeof
(guid->
unionDBusGUID.html#o1
as_bytes
) - ts_size);
00071 }
00072
00073
/* this is a little fragile since it assumes the address doesn't
00074
* already have a guid, but it shouldn't
00075
*/
00076
static
char
*
00077 copy_address_with_guid_appended (
const
structDBusString.html
DBusString
*address,
00078
const
structDBusString.html
DBusString
*guid_hex)
00079 {
00080
structDBusString.html
DBusString
with_guid;
00081
char
*retval;
00082
00083
if
(!
group__DBusString.html#ga6
_dbus_string_init
(&with_guid))
00084
return
group__DBusMacros.html#ga4
NULL
;
00085
00086
if
(!
group__DBusString.html#ga40
_dbus_string_copy
(address, 0, &with_guid,
00087                           _dbus_string_get_length (&with_guid)) ||
00088       !
group__DBusString.html#ga27
_dbus_string_append
(&with_guid,
",guid="
) ||
00089       !
group__DBusString.html#ga40
_dbus_string_copy
(guid_hex, 0,
00090                           &with_guid, _dbus_string_get_length (&with_guid)))
00091     {
00092
group__DBusString.html#ga9
_dbus_string_free
(&with_guid);
00093
return
group__DBusMacros.html#ga4
NULL
;
00094     }
00095
00096   retval =
group__DBusMacros.html#ga4
NULL
;
00097
group__DBusString.html#ga16
_dbus_string_steal_data
(&with_guid, &retval);
00098
00099
group__DBusString.html#ga9
_dbus_string_free
(&with_guid);
00100
00101
return
retval;
/* may be NULL if steal_data failed */
00102 }
00103
00113
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServerInternals.html#ga8
00114
group__DBusServerInternals.html#ga8
_dbus_server_init_base
(
structDBusServer.html
DBusServer
*server,
00115
const
structDBusServerVTable.html
DBusServerVTable
*vtable,
00116
const
structDBusString.html
DBusString
*address)
00117 {
00118
structDBusString.html
DBusString
guid_raw;
00119
00120   server->
structDBusServer.html#o1
vtable
= vtable;
00121   server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
= 1;
00122
00123   server->
structDBusServer.html#o7
address
=
group__DBusMacros.html#ga4
NULL
;
00124   server->
structDBusServer.html#o5
watches
=
group__DBusMacros.html#ga4
NULL
;
00125   server->
structDBusServer.html#o6
timeouts
=
group__DBusMacros.html#ga4
NULL
;
00126
00127
if
(!
group__DBusString.html#ga6
_dbus_string_init
(&server->
structDBusServer.html#o4
guid_hex
))
00128
return
group__DBusMacros.html#ga3
FALSE
;
00129
00130   init_guid (&server->
structDBusServer.html#o3
guid
);
00131
00132
group__DBusString.html#ga8
_dbus_string_init_const_len
(&guid_raw, (
signed
char
*) server->
structDBusServer.html#o3
guid
.
unionDBusGUID.html#o1
as_bytes
,
00133                                sizeof (server->
structDBusServer.html#o3
guid
.
unionDBusGUID.html#o1
as_bytes
));
00134
if
(!
group__DBusString.html#ga53
_dbus_string_hex_encode
(&guid_raw, 0,
00135                                 &server->
structDBusServer.html#o4
guid_hex
,
00136                                 _dbus_string_get_length (&server->
structDBusServer.html#o4
guid_hex
)))
00137
goto
failed;
00138
00139   server->
structDBusServer.html#o7
address
= copy_address_with_guid_appended (address,
00140                                                      &server->
structDBusServer.html#o4
guid_hex
);
00141
if
(server->
structDBusServer.html#o7
address
==
group__DBusMacros.html#ga4
NULL
)
00142
goto
failed;
00143
00144   server->
structDBusServer.html#o2
mutex
=
group__DBusThreadsInternals.html#ga0
_dbus_mutex_new
();
00145
if
(server->
structDBusServer.html#o2
mutex
==
group__DBusMacros.html#ga4
NULL
)
00146
goto
failed;
00147
00148   server->
structDBusServer.html#o5
watches
=
group__DBusWatchInternals.html#ga5
_dbus_watch_list_new
();
00149
if
(server->
structDBusServer.html#o5
watches
==
group__DBusMacros.html#ga4
NULL
)
00150
goto
failed;
00151
00152   server->
structDBusServer.html#o6
timeouts
=
group__DBusTimeoutInternals.html#ga5
_dbus_timeout_list_new
();
00153
if
(server->
structDBusServer.html#o6
timeouts
==
group__DBusMacros.html#ga4
NULL
)
00154
goto
failed;
00155
00156
group__DBusDataSlot.html#ga3
_dbus_data_slot_list_init
(&server->
structDBusServer.html#o9
slot_list
);
00157
00158   _dbus_verbose (
"Initialized server on address %s\n"
, server->
structDBusServer.html#o7
address
);
00159
00160
return
group__DBusMacros.html#ga2
TRUE
;
00161
00162  failed:
00163
if
(server->
structDBusServer.html#o2
mutex
)
00164     {
00165
group__DBusThreadsInternals.html#ga1
_dbus_mutex_free
(server->
structDBusServer.html#o2
mutex
);
00166       server->
structDBusServer.html#o2
mutex
=
group__DBusMacros.html#ga4
NULL
;
00167     }
00168
if
(server->
structDBusServer.html#o5
watches
)
00169     {
00170
group__DBusWatchInternals.html#ga6
_dbus_watch_list_free
(server->
structDBusServer.html#o5
watches
);
00171       server->
structDBusServer.html#o5
watches
=
group__DBusMacros.html#ga4
NULL
;
00172     }
00173
if
(server->
structDBusServer.html#o6
timeouts
)
00174     {
00175
group__DBusTimeoutInternals.html#ga6
_dbus_timeout_list_free
(server->
structDBusServer.html#o6
timeouts
);
00176       server->
structDBusServer.html#o6
timeouts
=
group__DBusMacros.html#ga4
NULL
;
00177     }
00178
if
(server->
structDBusServer.html#o7
address
)
00179     {
00180
group__DBusMemory.html#ga3
dbus_free
(server->
structDBusServer.html#o7
address
);
00181       server->
structDBusServer.html#o7
address
=
group__DBusMacros.html#ga4
NULL
;
00182     }
00183
group__DBusString.html#ga9
_dbus_string_free
(&server->
structDBusServer.html#o4
guid_hex
);
00184
00185
return
group__DBusMacros.html#ga3
FALSE
;
00186 }
00187
00194
void
group__DBusServerInternals.html#ga9
00195
group__DBusServerInternals.html#ga9
_dbus_server_finalize_base
(
structDBusServer.html
DBusServer
*server)
00196 {
00197
/* We don't have the lock, but nobody should be accessing
00198
* concurrently since they don't have a ref
00199
*/
00200
#ifndef DBUS_DISABLE_CHECKS
00201
group__DBusInternalsUtils.html#ga130
_dbus_assert
(!server->
structDBusServer.html#o15
have_server_lock
);
00202
#endif
00203
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o14
disconnected
);
00204
00205
/* calls out to application code... */
00206
group__DBusDataSlot.html#ga7
_dbus_data_slot_list_free
(&server->
structDBusServer.html#o9
slot_list
);
00207
00208
group__DBusServer.html#ga9
dbus_server_set_new_connection_function
(server,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
);
00209
00210
group__DBusWatchInternals.html#ga6
_dbus_watch_list_free
(server->
structDBusServer.html#o5
watches
);
00211
group__DBusTimeoutInternals.html#ga6
_dbus_timeout_list_free
(server->
structDBusServer.html#o6
timeouts
);
00212
00213
group__DBusThreadsInternals.html#ga1
_dbus_mutex_free
(server->
structDBusServer.html#o2
mutex
);
00214
00215
group__DBusMemory.html#ga3
dbus_free
(server->
structDBusServer.html#o7
address
);
00216
00217
group__DBusMemory.html#ga4
dbus_free_string_array
(server->
structDBusServer.html#o13
auth_mechanisms
);
00218
00219
group__DBusString.html#ga9
_dbus_string_free
(&server->
structDBusServer.html#o4
guid_hex
);
00220 }
00221
00222
group__DBusServerInternals.html#ga0
00223
typedef
group__DBusTypes.html#ga2
dbus_bool_t
(*
group__DBusConnectionInternals.html#ga2
DBusWatchAddFunction
)     (
structDBusWatchList.html
DBusWatchList
*list,
00224
structDBusWatch.html
DBusWatch
*watch);
group__DBusServerInternals.html#ga1
00225
typedef
void        (*
group__DBusConnectionInternals.html#ga3
DBusWatchRemoveFunction
)  (
structDBusWatchList.html
DBusWatchList
*list,
00226
structDBusWatch.html
DBusWatch
*watch);
group__DBusServerInternals.html#ga2
00227
typedef
void        (*
group__DBusConnectionInternals.html#ga4
DBusWatchToggleFunction
)  (
structDBusWatchList.html
DBusWatchList
*list,
00228
structDBusWatch.html
DBusWatch
*watch,
00229
group__DBusTypes.html#ga2
dbus_bool_t
enabled);
00230
00231
static
group__DBusTypes.html#ga2
dbus_bool_t
00232 protected_change_watch (
structDBusServer.html
DBusServer
*server,
00233
structDBusWatch.html
DBusWatch
*watch,
00234
group__DBusConnectionInternals.html#ga2
DBusWatchAddFunction
add_function,
00235
group__DBusConnectionInternals.html#ga3
DBusWatchRemoveFunction
remove_function,
00236
group__DBusConnectionInternals.html#ga4
DBusWatchToggleFunction
toggle_function,
00237
group__DBusTypes.html#ga2
dbus_bool_t
enabled)
00238 {
00239
structDBusWatchList.html
DBusWatchList
*watches;
00240
group__DBusTypes.html#ga2
dbus_bool_t
retval;
00241
00242   HAVE_LOCK_CHECK (server);
00243
00244
/* This isn't really safe or reasonable; a better pattern is the "do
00245
* everything, then drop lock and call out" one; but it has to be
00246
* propagated up through all callers
00247
*/
00248
00249   watches = server->
structDBusServer.html#o5
watches
;
00250
if
(watches)
00251     {
00252       server->
structDBusServer.html#o5
watches
=
group__DBusMacros.html#ga4
NULL
;
00253
group__DBusServer.html#ga4
_dbus_server_ref_unlocked
(server);
00254       SERVER_UNLOCK (server);
00255
00256
if
(add_function)
00257         retval = (* add_function) (watches, watch);
00258
else
if
(remove_function)
00259         {
00260           retval =
group__DBusMacros.html#ga2
TRUE
;
00261           (* remove_function) (watches, watch);
00262         }
00263
else
00264         {
00265           retval =
group__DBusMacros.html#ga2
TRUE
;
00266           (* toggle_function) (watches, watch, enabled);
00267         }
00268
00269       SERVER_LOCK (server);
00270       server->
structDBusServer.html#o5
watches
= watches;
00271
group__DBusServer.html#ga5
_dbus_server_unref_unlocked
(server);
00272
00273
return
retval;
00274     }
00275
else
00276
return
group__DBusMacros.html#ga3
FALSE
;
00277 }
00278
00286
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServerInternals.html#ga11
00287
group__DBusServerInternals.html#ga11
_dbus_server_add_watch
(
structDBusServer.html
DBusServer
*server,
00288
structDBusWatch.html
DBusWatch
*watch)
00289 {
00290   HAVE_LOCK_CHECK (server);
00291
return
protected_change_watch (server, watch,
00292
group__DBusWatchInternals.html#ga8
_dbus_watch_list_add_watch
,
00293
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00294 }
00295
00302
void
group__DBusServerInternals.html#ga12
00303
group__DBusServerInternals.html#ga12
_dbus_server_remove_watch
(
structDBusServer.html
DBusServer
*server,
00304
structDBusWatch.html
DBusWatch
*watch)
00305 {
00306   HAVE_LOCK_CHECK (server);
00307   protected_change_watch (server, watch,
00308
group__DBusMacros.html#ga4
NULL
,
00309
group__DBusWatchInternals.html#ga9
_dbus_watch_list_remove_watch
,
00310
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00311 }
00312
00322
void
group__DBusServerInternals.html#ga13
00323
group__DBusServerInternals.html#ga13
_dbus_server_toggle_watch
(
structDBusServer.html
DBusServer
*server,
00324
structDBusWatch.html
DBusWatch
*watch,
00325
group__DBusTypes.html#ga2
dbus_bool_t
enabled)
00326 {
00327
group__DBusInternalsUtils.html#ga130
_dbus_assert
(watch !=
group__DBusMacros.html#ga4
NULL
);
00328
00329   HAVE_LOCK_CHECK (server);
00330   protected_change_watch (server, watch,
00331
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
,
00332
group__DBusWatchInternals.html#ga10
_dbus_watch_list_toggle_watch
,
00333                           enabled);
00334 }
00335
00336
group__DBusServerInternals.html#ga3
00337
typedef
group__DBusTypes.html#ga2
dbus_bool_t
(*
group__DBusConnectionInternals.html#ga5
DBusTimeoutAddFunction
)    (
structDBusTimeoutList.html
DBusTimeoutList
*list,
00338
structDBusTimeout.html
DBusTimeout
*timeout);
group__DBusServerInternals.html#ga4
00339
typedef
void        (*
group__DBusConnectionInternals.html#ga6
DBusTimeoutRemoveFunction
) (
structDBusTimeoutList.html
DBusTimeoutList
*list,
00340
structDBusTimeout.html
DBusTimeout
*timeout);
group__DBusServerInternals.html#ga5
00341
typedef
void        (*
group__DBusConnectionInternals.html#ga7
DBusTimeoutToggleFunction
) (
structDBusTimeoutList.html
DBusTimeoutList
*list,
00342
structDBusTimeout.html
DBusTimeout
*timeout,
00343
group__DBusTypes.html#ga2
dbus_bool_t
enabled);
00344
00345
00346
static
group__DBusTypes.html#ga2
dbus_bool_t
00347 protected_change_timeout (
structDBusServer.html
DBusServer
*server,
00348
structDBusTimeout.html
DBusTimeout
*timeout,
00349
group__DBusConnectionInternals.html#ga5
DBusTimeoutAddFunction
add_function,
00350
group__DBusConnectionInternals.html#ga6
DBusTimeoutRemoveFunction
remove_function,
00351
group__DBusConnectionInternals.html#ga7
DBusTimeoutToggleFunction
toggle_function,
00352
group__DBusTypes.html#ga2
dbus_bool_t
enabled)
00353 {
00354
structDBusTimeoutList.html
DBusTimeoutList
*timeouts;
00355
group__DBusTypes.html#ga2
dbus_bool_t
retval;
00356
00357   HAVE_LOCK_CHECK (server);
00358
00359
/* This isn't really safe or reasonable; a better pattern is the "do everything, then
00360
* drop lock and call out" one; but it has to be propagated up through all callers
00361
*/
00362
00363   timeouts = server->
structDBusServer.html#o6
timeouts
;
00364
if
(timeouts)
00365     {
00366       server->
structDBusServer.html#o6
timeouts
=
group__DBusMacros.html#ga4
NULL
;
00367
group__DBusServer.html#ga4
_dbus_server_ref_unlocked
(server);
00368       SERVER_UNLOCK (server);
00369
00370
if
(add_function)
00371         retval = (* add_function) (timeouts, timeout);
00372
else
if
(remove_function)
00373         {
00374           retval =
group__DBusMacros.html#ga2
TRUE
;
00375           (* remove_function) (timeouts, timeout);
00376         }
00377
else
00378         {
00379           retval =
group__DBusMacros.html#ga2
TRUE
;
00380           (* toggle_function) (timeouts, timeout, enabled);
00381         }
00382
00383       SERVER_LOCK (server);
00384       server->
structDBusServer.html#o6
timeouts
= timeouts;
00385
group__DBusServer.html#ga5
_dbus_server_unref_unlocked
(server);
00386
00387
return
retval;
00388     }
00389
else
00390
return
group__DBusMacros.html#ga3
FALSE
;
00391 }
00392
00402
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServerInternals.html#ga15
00403
group__DBusServerInternals.html#ga15
_dbus_server_add_timeout
(
structDBusServer.html
DBusServer
*server,
00404
structDBusTimeout.html
DBusTimeout
*timeout)
00405 {
00406
return
protected_change_timeout (server, timeout,
00407
group__DBusTimeoutInternals.html#ga8
_dbus_timeout_list_add_timeout
,
00408
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00409 }
00410
00417
void
group__DBusServerInternals.html#ga16
00418
group__DBusServerInternals.html#ga16
_dbus_server_remove_timeout
(
structDBusServer.html
DBusServer
*server,
00419
structDBusTimeout.html
DBusTimeout
*timeout)
00420 {
00421   protected_change_timeout (server, timeout,
00422
group__DBusMacros.html#ga4
NULL
,
00423
group__DBusTimeoutInternals.html#ga9
_dbus_timeout_list_remove_timeout
,
00424
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00425 }
00426
00436
void
group__DBusServerInternals.html#ga17
00437
group__DBusServerInternals.html#ga17
_dbus_server_toggle_timeout
(
structDBusServer.html
DBusServer
*server,
00438
structDBusTimeout.html
DBusTimeout
*timeout,
00439
group__DBusTypes.html#ga2
dbus_bool_t
enabled)
00440 {
00441   protected_change_timeout (server, timeout,
00442
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
,
00443
group__DBusTimeoutInternals.html#ga10
_dbus_timeout_list_toggle_timeout
,
00444                             enabled);
00445 }
00446
00447
00485
structDBusServer.html
DBusServer
*
group__DBusServer.html#ga1
00486
group__DBusServer.html#ga1
dbus_server_listen
(
const
char
*address,
00487
structDBusError.html
DBusError
*error)
00488 {
00489
structDBusServer.html
DBusServer
*server;
00490
structDBusAddressEntry.html
DBusAddressEntry
**entries;
00491
int
len, i;
00492
const
char
*address_problem_type;
00493
const
char
*address_problem_field;
00494
const
char
*address_problem_other;
00495
00496   _dbus_return_val_if_fail (address !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
);
00497   _dbus_return_val_if_error_is_set (error,
group__DBusMacros.html#ga4
NULL
);
00498
00499
if
(!
group__DBusAddress.html#ga6
dbus_parse_address
(address, &entries, &len, error))
00500
return
group__DBusMacros.html#ga4
NULL
;
00501
00502   server =
group__DBusMacros.html#ga4
NULL
;
00503   address_problem_type =
group__DBusMacros.html#ga4
NULL
;
00504   address_problem_field =
group__DBusMacros.html#ga4
NULL
;
00505   address_problem_other =
group__DBusMacros.html#ga4
NULL
;
00506
00507
for
(i = 0; i < len; i++)
00508     {
00509
const
char
*method;
00510
00511       method =
group__DBusAddress.html#ga2
dbus_address_entry_get_method
(entries[i]);
00512
00513
if
(strcmp (method,
"unix"
) == 0)
00514         {
00515
const
char
*path =
group__DBusAddress.html#ga3
dbus_address_entry_get_value
(entries[i],
"path"
);
00516
const
char
*tmpdir =
group__DBusAddress.html#ga3
dbus_address_entry_get_value
(entries[i],
"tmpdir"
);
00517
const
char
*
abstract
=
group__DBusAddress.html#ga3
dbus_address_entry_get_value
(entries[i],
"abstract"
);
00518
00519
if
(path ==
group__DBusMacros.html#ga4
NULL
&& tmpdir ==
group__DBusMacros.html#ga4
NULL
&&
abstract
==
group__DBusMacros.html#ga4
NULL
)
00520             {
00521               address_problem_type =
"unix"
;
00522               address_problem_field =
"path or tmpdir or abstract"
;
00523
goto
bad_address;
00524             }
00525
00526
if
((path && tmpdir) ||
00527               (path &&
abstract
) ||
00528               (tmpdir &&
abstract
))
00529             {
00530               address_problem_other =
"cannot specify two of \"path\" and \"tmpdir\" and \"abstract\" at the same time"
;
00531
goto
bad_address;
00532             }
00533
00534
if
(tmpdir !=
group__DBusMacros.html#ga4
NULL
)
00535             {
00536
structDBusString.html
DBusString
full_path;
00537
structDBusString.html
DBusString
filename;
00538
00539
if
(!
group__DBusString.html#ga6
_dbus_string_init
(&full_path))
00540                 {
00541
group__DBusErrors.html#ga6
dbus_set_error
(error, DBUS_ERROR_NO_MEMORY,
group__DBusMacros.html#ga4
NULL
);
00542
goto
out;
00543                 }
00544
00545
if
(!
group__DBusString.html#ga6
_dbus_string_init
(&filename))
00546                 {
00547
group__DBusString.html#ga9
_dbus_string_free
(&full_path);
00548
group__DBusErrors.html#ga6
dbus_set_error
(error, DBUS_ERROR_NO_MEMORY,
group__DBusMacros.html#ga4
NULL
);
00549
goto
out;
00550                 }
00551
00552
if
(!
group__DBusString.html#ga27
_dbus_string_append
(&filename,
00553
"dbus-"
) ||
00554                   !
group__DBusInternalsUtils.html#ga95
_dbus_generate_random_ascii
(&filename, 10) ||
00555                   !
group__DBusString.html#ga27
_dbus_string_append
(&full_path, tmpdir) ||
00556                   !
group__DBusInternalsUtils.html#ga90
_dbus_concat_dir_and_file
(&full_path, &filename))
00557                 {
00558
group__DBusString.html#ga9
_dbus_string_free
(&full_path);
00559
group__DBusString.html#ga9
_dbus_string_free
(&filename);
00560
group__DBusErrors.html#ga6
dbus_set_error
(error, DBUS_ERROR_NO_MEMORY,
group__DBusMacros.html#ga4
NULL
);
00561
goto
out;
00562                 }
00563
00564
/* FIXME - we will unconditionally unlink() the path if
00565
* we don't support abstract namespace.  unlink() does
00566
* not follow symlinks, but would like independent
00567
* confirmation this is safe enough. See also
00568
* _dbus_listen_unix_socket() and comments therein.
00569
*/
00570
00571
/* Always use abstract namespace if possible with tmpdir */
00572
00573               server =
00574
group__DBusServerUnix.html#ga7
_dbus_server_new_for_domain_socket
(_dbus_string_get_const_data (&full_path),
00575 #ifdef HAVE_ABSTRACT_SOCKETS
00576
group__DBusMacros.html#ga2
TRUE
,
00577 #
else
00578
group__DBusMacros.html#ga3
FALSE
,
00579 #endif
00580                                                     error);
00581
00582
group__DBusString.html#ga9
_dbus_string_free
(&full_path);
00583
group__DBusString.html#ga9
_dbus_string_free
(&filename);
00584             }
00585
else
00586             {
00587
if
(path)
00588                 server =
group__DBusServerUnix.html#ga7
_dbus_server_new_for_domain_socket
(path,
group__DBusMacros.html#ga3
FALSE
, error);
00589
else
00590                 server =
group__DBusServerUnix.html#ga7
_dbus_server_new_for_domain_socket
(
abstract
,
group__DBusMacros.html#ga2
TRUE
, error);
00591             }
00592         }
00593
else
if
(strcmp (method,
"tcp"
) == 0)
00594         {
00595
const
char
*host =
group__DBusAddress.html#ga3
dbus_address_entry_get_value
(entries[i],
"host"
);
00596
const
char
*port =
group__DBusAddress.html#ga3
dbus_address_entry_get_value
(entries[i],
"port"
);
00597
structDBusString.html
DBusString
str;
00598
long
lport;
00599
group__DBusTypes.html#ga2
dbus_bool_t
sresult;
00600
00601
if
(port ==
group__DBusMacros.html#ga4
NULL
)
00602             {
00603               address_problem_type =
"tcp"
;
00604               address_problem_field =
"port"
;
00605
goto
bad_address;
00606             }
00607
00608
group__DBusString.html#ga7
_dbus_string_init_const
(&str, port);
00609           sresult =
group__DBusString.html#ga62
_dbus_string_parse_int
(&str, 0, &lport,
group__DBusMacros.html#ga4
NULL
);
00610
group__DBusString.html#ga9
_dbus_string_free
(&str);
00611
00612
if
(sresult ==
group__DBusMacros.html#ga3
FALSE
|| lport <= 0 || lport > 65535)
00613             {
00614               address_problem_other =
"Port is not an integer between 0 and 65535"
;
00615
goto
bad_address;
00616             }
00617
00618           server =
group__DBusServerUnix.html#ga8
_dbus_server_new_for_tcp_socket
(host, lport, error);
00619
00620
if
(server)
00621
break
;
00622         }
00623
#ifdef DBUS_BUILD_TESTS
00624
else
if
(strcmp (method,
"debug-pipe"
) == 0)
00625         {
00626
const
char
*name =
group__DBusAddress.html#ga3
dbus_address_entry_get_value
(entries[i],
"name"
);
00627
00628
if
(name ==
group__DBusMacros.html#ga4
NULL
)
00629             {
00630               address_problem_type =
"debug-pipe"
;
00631               address_problem_field =
"name"
;
00632
goto
bad_address;
00633             }
00634
00635           server = _dbus_server_debug_pipe_new (name, error);
00636         }
00637
#endif
00638
else
00639         {
00640           address_problem_other =
"Unknown address type (examples of valid types are \"unix\" and \"tcp\")"
;
00641
goto
bad_address;
00642         }
00643
00644
if
(server)
00645
break
;
00646     }
00647
00648  out:
00649
00650
group__DBusAddress.html#ga0
dbus_address_entries_free
(entries);
00651
return
server;
00652
00653  bad_address:
00654
group__DBusAddress.html#ga0
dbus_address_entries_free
(entries);
00655
if
(address_problem_type !=
group__DBusMacros.html#ga4
NULL
)
00656
group__DBusErrors.html#ga6
dbus_set_error
(error, DBUS_ERROR_BAD_ADDRESS,
00657
"Server address of type %s was missing argument %s"
,
00658                     address_problem_type, address_problem_field);
00659
else
00660
group__DBusErrors.html#ga6
dbus_set_error
(error, DBUS_ERROR_BAD_ADDRESS,
00661
"Could not parse server address: %s"
,
00662                     address_problem_other);
00663
00664
return
group__DBusMacros.html#ga4
NULL
;
00665 }
00666
00673
structDBusServer.html
DBusServer
*
group__DBusServer.html#ga2
00674
group__DBusServer.html#ga2
dbus_server_ref
(
structDBusServer.html
DBusServer
*server)
00675 {
00676   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
);
00677   _dbus_return_val_if_fail (server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0,
group__DBusMacros.html#ga4
NULL
);
00678
00679
#ifdef DBUS_HAVE_ATOMIC_INT
00680
group__DBusInternalsUtils.html#ga80
_dbus_atomic_inc
(&server->
structDBusServer.html#o0
refcount
);
00681
#else
00682
SERVER_LOCK (server);
00683
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00684
00685   server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
+= 1;
00686   SERVER_UNLOCK (server);
00687
#endif
00688
00689
return
server;
00690 }
00691
00700
void
group__DBusServer.html#ga3
00701
group__DBusServer.html#ga3
dbus_server_unref
(
structDBusServer.html
DBusServer
*server)
00702 {
00703
group__DBusTypes.html#ga2
dbus_bool_t
last_unref;
00704
00705   _dbus_return_if_fail (server !=
group__DBusMacros.html#ga4
NULL
);
00706   _dbus_return_if_fail (server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00707
00708
#ifdef DBUS_HAVE_ATOMIC_INT
00709
last_unref = (
group__DBusInternalsUtils.html#ga81
_dbus_atomic_dec
(&server->
structDBusServer.html#o0
refcount
) == 1);
00710
#else
00711
SERVER_LOCK (server);
00712
00713
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00714
00715   server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
-= 1;
00716   last_unref = (server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
== 0);
00717
00718   SERVER_UNLOCK (server);
00719
#endif
00720
00721
if
(last_unref)
00722     {
00723
/* lock not held! */
00724
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o14
disconnected
);
00725
00726
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o1
vtable
->
structDBusServerVTable.html#o0
finalize
!=
group__DBusMacros.html#ga4
NULL
);
00727
00728       (* server->
structDBusServer.html#o1
vtable
->
structDBusServerVTable.html#o0
finalize
) (server);
00729     }
00730 }
00731
00737
void
group__DBusServer.html#ga4
00738
group__DBusServer.html#ga4
_dbus_server_ref_unlocked
(
structDBusServer.html
DBusServer
*server)
00739 {
00740
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server !=
group__DBusMacros.html#ga4
NULL
);
00741
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00742
00743   HAVE_LOCK_CHECK (server);
00744
00745
#ifdef DBUS_HAVE_ATOMIC_INT
00746
group__DBusInternalsUtils.html#ga80
_dbus_atomic_inc
(&server->
structDBusServer.html#o0
refcount
);
00747
#else
00748
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00749
00750   server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
+= 1;
00751
#endif
00752
}
00753
00759
void
group__DBusServer.html#ga5
00760
group__DBusServer.html#ga5
_dbus_server_unref_unlocked
(
structDBusServer.html
DBusServer
*server)
00761 {
00762
group__DBusTypes.html#ga2
dbus_bool_t
last_unref;
00763
00764
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server !=
group__DBusMacros.html#ga4
NULL
);
00765
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00766
00767   HAVE_LOCK_CHECK (server);
00768
00769
#ifdef DBUS_HAVE_ATOMIC_INT
00770
last_unref = (
group__DBusInternalsUtils.html#ga81
_dbus_atomic_dec
(&server->
structDBusServer.html#o0
refcount
) == 1);
00771
#else
00772
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00773
00774   server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
-= 1;
00775   last_unref = (server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
== 0);
00776
#endif
00777
00778
if
(last_unref)
00779     {
00780
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o14
disconnected
);
00781
00782       SERVER_UNLOCK (server);
00783
00784
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o1
vtable
->
structDBusServerVTable.html#o0
finalize
!=
group__DBusMacros.html#ga4
NULL
);
00785
00786       (* server->
structDBusServer.html#o1
vtable
->
structDBusServerVTable.html#o0
finalize
) (server);
00787     }
00788 }
00789
00798
void
group__DBusServer.html#ga6
00799
group__DBusServer.html#ga6
dbus_server_disconnect
(
structDBusServer.html
DBusServer
*server)
00800 {
00801   _dbus_return_if_fail (server !=
group__DBusMacros.html#ga4
NULL
);
00802   _dbus_return_if_fail (server->
structDBusServer.html#o0
refcount
.
structDBusAtomic.html#o0
value
> 0);
00803
00804   SERVER_LOCK (server);
00805
group__DBusServer.html#ga4
_dbus_server_ref_unlocked
(server);
00806
00807
group__DBusInternalsUtils.html#ga130
_dbus_assert
(server->
structDBusServer.html#o1
vtable
->
structDBusServerVTable.html#o1
disconnect
!=
group__DBusMacros.html#ga4
NULL
);
00808
00809
if
(!server->
structDBusServer.html#o14
disconnected
)
00810     {
00811
/* this has to be first so recursive calls to disconnect don't happen */
00812       server->
structDBusServer.html#o14
disconnected
=
group__DBusMacros.html#ga2
TRUE
;
00813
00814       (* server->
structDBusServer.html#o1
vtable
->
structDBusServerVTable.html#o1
disconnect
) (server);
00815     }
00816
00817   SERVER_UNLOCK (server);
00818
group__DBusServer.html#ga3
dbus_server_unref
(server);
00819 }
00820
00826
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga7
00827
group__DBusServer.html#ga7
dbus_server_get_is_connected
(
structDBusServer.html
DBusServer
*server)
00828 {
00829
group__DBusTypes.html#ga2
dbus_bool_t
retval;
00830
00831   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00832
00833   SERVER_LOCK (server);
00834   retval = !server->
structDBusServer.html#o14
disconnected
;
00835   SERVER_UNLOCK (server);
00836
00837
return
retval;
00838 }
00839
00847
char
*
group__DBusServer.html#ga8
00848
group__DBusServer.html#ga8
dbus_server_get_address
(
structDBusServer.html
DBusServer
*server)
00849 {
00850
char
*retval;
00851
00852   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
);
00853
00854   SERVER_LOCK (server);
00855   retval =
group__DBusInternalsUtils.html#ga8
_dbus_strdup
(server->
structDBusServer.html#o7
address
);
00856   SERVER_UNLOCK (server);
00857
00858
return
retval;
00859 }
00860
00873
void
group__DBusServer.html#ga9
00874
group__DBusServer.html#ga9
dbus_server_set_new_connection_function
(
structDBusServer.html
DBusServer
*server,
00875                                          DBusNewConnectionFunction  function,
00876
void
*data,
00877
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
00878 {
00879
group__DBusMemory.html#ga8
DBusFreeFunction
old_free_function;
00880
void
*old_data;
00881
00882   _dbus_return_if_fail (server !=
group__DBusMacros.html#ga4
NULL
);
00883
00884   SERVER_LOCK (server);
00885   old_free_function = server->
structDBusServer.html#o12
new_connection_free_data_function
;
00886   old_data = server->
structDBusServer.html#o11
new_connection_data
;
00887
00888   server->
structDBusServer.html#o10
new_connection_function
= function;
00889   server->
structDBusServer.html#o11
new_connection_data
= data;
00890   server->
structDBusServer.html#o12
new_connection_free_data_function
= free_data_function;
00891   SERVER_UNLOCK (server);
00892
00893
if
(old_free_function !=
group__DBusMacros.html#ga4
NULL
)
00894     (* old_free_function) (old_data);
00895 }
00896
00913
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga10
00914
group__DBusServer.html#ga10
dbus_server_set_watch_functions
(
structDBusServer.html
DBusServer
*server,
00915                                  DBusAddWatchFunction     add_function,
00916                                  DBusRemoveWatchFunction  remove_function,
00917                                  DBusWatchToggledFunction toggled_function,
00918
void
*data,
00919
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
00920 {
00921
group__DBusTypes.html#ga2
dbus_bool_t
result;
00922
structDBusWatchList.html
DBusWatchList
*watches;
00923
00924   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00925
00926   SERVER_LOCK (server);
00927   watches = server->
structDBusServer.html#o5
watches
;
00928   server->
structDBusServer.html#o5
watches
=
group__DBusMacros.html#ga4
NULL
;
00929
if
(watches)
00930     {
00931       SERVER_UNLOCK (server);
00932       result =
group__DBusWatchInternals.html#ga7
_dbus_watch_list_set_functions
(watches,
00933                                                add_function,
00934                                                remove_function,
00935                                                toggled_function,
00936                                                data,
00937                                                free_data_function);
00938       SERVER_LOCK (server);
00939     }
00940
else
00941     {
00942
group__DBusInternalsUtils.html#ga7
_dbus_warn
(
"Re-entrant call to %s\n"
, _DBUS_FUNCTION_NAME);
00943       result =
group__DBusMacros.html#ga3
FALSE
;
00944     }
00945   server->
structDBusServer.html#o5
watches
= watches;
00946   SERVER_UNLOCK (server);
00947
00948
return
result;
00949 }
00950
00966
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga11
00967
group__DBusServer.html#ga11
dbus_server_set_timeout_functions
(
structDBusServer.html
DBusServer
*server,
00968                                    DBusAddTimeoutFunction     add_function,
00969                                    DBusRemoveTimeoutFunction  remove_function,
00970                                    DBusTimeoutToggledFunction toggled_function,
00971
void
*data,
00972
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
00973 {
00974
group__DBusTypes.html#ga2
dbus_bool_t
result;
00975
structDBusTimeoutList.html
DBusTimeoutList
*timeouts;
00976
00977   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
00978
00979   SERVER_LOCK (server);
00980   timeouts = server->
structDBusServer.html#o6
timeouts
;
00981   server->
structDBusServer.html#o6
timeouts
=
group__DBusMacros.html#ga4
NULL
;
00982
if
(timeouts)
00983     {
00984       SERVER_UNLOCK (server);
00985       result =
group__DBusTimeoutInternals.html#ga7
_dbus_timeout_list_set_functions
(timeouts,
00986                                                  add_function,
00987                                                  remove_function,
00988                                                  toggled_function,
00989                                                  data,
00990                                                  free_data_function);
00991       SERVER_LOCK (server);
00992     }
00993
else
00994     {
00995
group__DBusInternalsUtils.html#ga7
_dbus_warn
(
"Re-entrant call to %s\n"
, _DBUS_FUNCTION_NAME);
00996       result =
group__DBusMacros.html#ga3
FALSE
;
00997     }
00998   server->
structDBusServer.html#o6
timeouts
= timeouts;
00999   SERVER_UNLOCK (server);
01000
01001
return
result;
01002 }
01003
01014
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga12
01015
group__DBusServer.html#ga12
dbus_server_set_auth_mechanisms
(
structDBusServer.html
DBusServer
*server,
01016
const
char
**mechanisms)
01017 {
01018
char
**copy;
01019
01020   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
01021
01022   SERVER_LOCK (server);
01023
01024
if
(mechanisms !=
group__DBusMacros.html#ga4
NULL
)
01025     {
01026       copy =
group__DBusInternalsUtils.html#ga10
_dbus_dup_string_array
(mechanisms);
01027
if
(copy ==
group__DBusMacros.html#ga4
NULL
)
01028
return
group__DBusMacros.html#ga3
FALSE
;
01029     }
01030
else
01031     copy =
group__DBusMacros.html#ga4
NULL
;
01032
01033
group__DBusMemory.html#ga4
dbus_free_string_array
(server->
structDBusServer.html#o13
auth_mechanisms
);
01034   server->
structDBusServer.html#o13
auth_mechanisms
= copy;
01035
01036   SERVER_UNLOCK (server);
01037
01038
return
group__DBusMacros.html#ga2
TRUE
;
01039 }
01040
01041
01042
static
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
slot_allocator;
01043
group__DBusInternalsUtils.html#ga146
_DBUS_DEFINE_GLOBAL_LOCK
(server_slots);
01044
01059
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga13
01060
group__DBusServer.html#ga13
dbus_server_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
01061 {
01062
return
group__DBusDataSlot.html#ga1
_dbus_data_slot_allocator_alloc
(&slot_allocator,
01063
group__DBusInternalsUtils.html#ga145
_DBUS_LOCK_NAME
(server_slots),
01064                                           slot_p);
01065 }
01066
01078
void
group__DBusServer.html#ga14
01079
group__DBusServer.html#ga14
dbus_server_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
01080 {
01081   _dbus_return_if_fail (*slot_p >= 0);
01082
01083
group__DBusDataSlot.html#ga2
_dbus_data_slot_allocator_free
(&slot_allocator, slot_p);
01084 }
01085
01099
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga15
01100
group__DBusServer.html#ga15
dbus_server_set_data
(
structDBusServer.html
DBusServer
*server,
01101
int
slot,
01102
void
*data,
01103
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func)
01104 {
01105
group__DBusMemory.html#ga8
DBusFreeFunction
old_free_func;
01106
void
*old_data;
01107
group__DBusTypes.html#ga2
dbus_bool_t
retval;
01108
01109   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga3
FALSE
);
01110
01111   SERVER_LOCK (server);
01112
01113   retval =
group__DBusDataSlot.html#ga4
_dbus_data_slot_list_set
(&slot_allocator,
01114                                      &server->
structDBusServer.html#o9
slot_list
,
01115                                      slot, data, free_data_func,
01116                                      &old_free_func, &old_data);
01117
01118
01119   SERVER_UNLOCK (server);
01120
01121
if
(retval)
01122     {
01123
/* Do the actual free outside the server lock */
01124
if
(old_free_func)
01125         (* old_free_func) (old_data);
01126     }
01127
01128
return
retval;
01129 }
01130
01139
void
*
group__DBusServer.html#ga16
01140
group__DBusServer.html#ga16
dbus_server_get_data
(
structDBusServer.html
DBusServer
*server,
01141
int
slot)
01142 {
01143
void
*res;
01144
01145   _dbus_return_val_if_fail (server !=
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga4
NULL
);
01146
01147   SERVER_LOCK (server);
01148
01149   res =
group__DBusDataSlot.html#ga5
_dbus_data_slot_list_get
(&slot_allocator,
01150                                   &server->
structDBusServer.html#o9
slot_list
,
01151                                   slot);
01152
01153   SERVER_UNLOCK (server);
01154
01155
return
res;
01156 }
01157
01160
#ifdef DBUS_BUILD_TESTS
01161
#include "dbus-test.h"
01162
01163
group__DBusTypes.html#ga2
dbus_bool_t
01164 _dbus_server_test (
void
)
01165 {
01166
const
char
*valid_addresses[] = {
01167
"tcp:port=1234"
,
01168
"unix:path=./boogie"
,
01169
"tcp:host=localhost,port=1234"
,
01170
"tcp:host=localhost,port=1234;tcp:port=5678"
,
01171
"tcp:port=1234;unix:path=./boogie"
,
01172   };
01173
01174
structDBusServer.html
DBusServer
*server;
01175
int
i;
01176
01177
for
(i = 0; i <
group__DBusInternalsUtils.html#ga132
_DBUS_N_ELEMENTS
(valid_addresses); i++)
01178     {
01179       server =
group__DBusServer.html#ga1
dbus_server_listen
(valid_addresses[i],
group__DBusMacros.html#ga4
NULL
);
01180
if
(server ==
group__DBusMacros.html#ga4
NULL
)
01181
group__DBusInternalsUtils.html#ga131
_dbus_assert_not_reached
(
"Failed to listen for valid address."
);
01182
01183
group__DBusServer.html#ga6
dbus_server_disconnect
(server);
01184
group__DBusServer.html#ga3
dbus_server_unref
(server);
01185
01186
/* Try disconnecting before unreffing */
01187       server =
group__DBusServer.html#ga1
dbus_server_listen
(valid_addresses[i],
group__DBusMacros.html#ga4
NULL
);
01188
if
(server ==
group__DBusMacros.html#ga4
NULL
)
01189
group__DBusInternalsUtils.html#ga131
_dbus_assert_not_reached
(
"Failed to listen for valid address."
);
01190
01191
group__DBusServer.html#ga6
dbus_server_disconnect
(server);
01192
group__DBusServer.html#ga3
dbus_server_unref
(server);
01193     }
01194
01195
return
group__DBusMacros.html#ga2
TRUE
;
01196 }
01197
01198
#endif
/* DBUS_BUILD_TESTS */
Generated on Tue Sep 13 01:28:07 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
