Changeset ff8348650ab13cd736fb6ce92ca6e552d7b5c955

Show
Ignore:
Timestamp:
12/02/10 05:22:05 (2 years ago)
Author:
Nedko Arnaudov <nedko@…>
Children:
68049ee6cb9d9109c9fb235345d54e500c384036
Parents:
b8852eaf9f2cba6aaa741a3baaef583c5efb755d
git-author:
Nedko Arnaudov <nedko@arnaudov.name> / 2010-12-02T05:21:51Z+0200
git-committer:
Nedko Arnaudov <nedko@arnaudov.name> / 2010-12-02T05:22:05Z+0200
Message:

Move the dbus call default timeout define out of the interface header

The default timeout is a property of the implementation, not the interface

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dbus/helpers.c

    r7a6f304 rff83486  
    3939#include "../common/klist.h" 
    4040 
     41#define DBUS_CALL_DEFAULT_TIMEOUT 3000 // in milliseconds 
     42 
    4143DBusConnection * g_dbus_connection; 
    4244DBusError g_dbus_error; 
     
    331333 
    332334  return true; 
     335} 
     336 
     337DBusMessage * 
     338dbus_call_raw( 
     339  unsigned int timeout, 
     340  DBusMessage * request_ptr) 
     341{ 
     342  DBusMessage * reply_ptr; 
     343 
     344  if (timeout == 0) 
     345  { 
     346    timeout = DBUS_CALL_DEFAULT_TIMEOUT; 
     347  } 
     348 
     349  reply_ptr = dbus_connection_send_with_reply_and_block( 
     350    g_dbus_connection, 
     351    request_ptr, 
     352    timeout, 
     353    &g_dbus_error); 
     354  if (reply_ptr == NULL) 
     355  { 
     356    //log_error("calling method '%s' failed, error is '%s'", method, g_dbus_error.message); 
     357    dbus_error_free(&g_dbus_error); 
     358  } 
     359 
     360  return reply_ptr; 
    333361} 
    334362 
     
    356384  //log_info("dbus_call('%s', '%s', '%s', '%s')", service, object, iface, method); 
    357385 
    358   if (timeout == 0) 
    359   { 
    360     timeout = DBUS_CALL_DEFAULT_TIMEOUT; 
    361   } 
    362  
    363386  ret = false; 
    364387  va_start(ap, input_signature); 
     
    411434  output_signature = va_arg(ap, const char *); 
    412435 
    413   reply_ptr = dbus_connection_send_with_reply_and_block( 
    414     g_dbus_connection, 
    415     request_ptr, 
    416     timeout, 
    417     &g_dbus_error); 
     436  reply_ptr = dbus_call_raw(timeout, request_ptr); 
    418437 
    419438  if (input_signature != NULL) 
     
    424443  if (reply_ptr == NULL) 
    425444  { 
    426     //log_error("calling method '%s' failed, error is '%s'", method, g_dbus_error.message); 
    427     dbus_error_free(&g_dbus_error); 
    428445    goto fail; 
    429446  } 
  • dbus/helpers.h

    r7a6f304 rff83486  
    4343bool dbus_add_dict_entry_uint32(DBusMessageIter * dict_iter_ptr, const char * key, dbus_uint32_t value); 
    4444bool dbus_add_dict_entry_bool(DBusMessageIter * dict_iter_ptr, const char * key, dbus_bool_t value); 
     45 
     46DBusMessage * 
     47dbus_call_raw( 
     48  unsigned int timeout,         /* in milliseconds */ 
     49  DBusMessage * request_ptr); 
    4550 
    4651bool 
     
    107112  const char * service); 
    108113 
    109 #define DBUS_CALL_DEFAULT_TIMEOUT 3000 // in milliseconds 
    110  
    111114#include "method.h" 
    112115#include "signal.h" 
  • proxies/jack_proxy.c

    rb8852ea rff83486  
    227227  } 
    228228 
    229   // send message and get a handle for a reply 
    230   reply_ptr = dbus_connection_send_with_reply_and_block( 
    231     g_dbus_connection, 
    232     request_ptr, 
    233     DBUS_CALL_DEFAULT_TIMEOUT, 
    234     &g_dbus_error); 
    235  
     229  reply_ptr = dbus_call_raw(0, request_ptr); 
    236230  dbus_message_unref(request_ptr); 
    237  
    238231  if (reply_ptr == NULL) 
    239232  { 
    240     log_error("no reply from JACK server, error is '%s'", g_dbus_error.message); 
    241     dbus_error_free(&g_dbus_error); 
    242233    return false; 
    243234  } 
     
    359350  } 
    360351 
    361   // send message and get a handle for a reply 
    362   reply_ptr = dbus_connection_send_with_reply_and_block( 
    363     g_dbus_connection, 
    364     request_ptr, 
    365     DBUS_CALL_DEFAULT_TIMEOUT, 
    366     &g_dbus_error); 
    367  
     352  reply_ptr = dbus_call_raw(0, request_ptr); 
    368353  dbus_message_unref(request_ptr); 
    369  
    370354  if (reply_ptr == NULL) 
    371355  { 
    372     log_error("no reply from JACK server, error is '%s'", g_dbus_error.message); 
    373     dbus_error_free(&g_dbus_error); 
    374356    return false; 
    375357  } 
     
    477459  } 
    478460 
    479   // send message and get a handle for a reply 
    480   reply_ptr = dbus_connection_send_with_reply_and_block( 
    481     g_dbus_connection, 
    482     request_ptr, 
    483     DBUS_CALL_DEFAULT_TIMEOUT, 
    484     &g_dbus_error); 
    485  
     461  reply_ptr = dbus_call_raw(0, request_ptr); 
    486462  dbus_message_unref(request_ptr); 
    487  
    488463  if (reply_ptr == NULL) 
    489464  { 
    490     log_error("no reply from JACK server, error is '%s'", g_dbus_error.message); 
    491     dbus_error_free(&g_dbus_error); 
    492465    return false; 
    493466  } 
     
    530503  } 
    531504 
    532   // send message and get a handle for a reply 
    533   reply_ptr = dbus_connection_send_with_reply_and_block( 
    534     g_dbus_connection, 
    535     request_ptr, 
    536     DBUS_CALL_DEFAULT_TIMEOUT, 
    537     &g_dbus_error); 
    538  
     505  reply_ptr = dbus_call_raw(0, request_ptr); 
    539506  dbus_message_unref(request_ptr); 
    540  
    541507  if (reply_ptr == NULL) 
    542508  { 
    543     log_error("no reply from JACK server, error is '%s'", g_dbus_error.message); 
    544     dbus_error_free(&g_dbus_error); 
    545509    return false; 
    546510  }