rpms/dbus/devel dbus-0.61.dbus-connection.c.backport.patch, NONE, 1.1 dbus.spec, 1.75, 1.76

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 25 18:33:57 UTC 2006


Author: johnp

Update of /cvs/dist/rpms/dbus/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26444

Modified Files:
	dbus.spec 
Added Files:
	dbus-0.61.dbus-connection.c.backport.patch 
Log Message:
* Tue Apr 25 2006 John (J5) Palmieri <johnp at redhat.com> - 0.61-4
- Backport patch from dbus-connection.c
  - Allows interfaces to be NULL in the message header as per the spec
  - Fixes a problem with pendings calls blocking on a data starved socket



dbus-0.61.dbus-connection.c.backport.patch:
 dbus-connection.c |   67 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 42 insertions(+), 25 deletions(-)

--- NEW FILE dbus-0.61.dbus-connection.c.backport.patch ---
--- dbus-0.61/dbus/dbus-connection.c.backport	2006-04-25 14:26:31.000000000 -0400
+++ dbus-0.61/dbus/dbus-connection.c	2006-04-25 14:26:54.000000000 -0400
@@ -2257,8 +2257,7 @@
   _dbus_return_if_fail (message != NULL);
   _dbus_return_if_fail (preallocated->connection == connection);
   _dbus_return_if_fail (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL ||
-                        (dbus_message_get_interface (message) != NULL &&
-                         dbus_message_get_member (message) != NULL));
+                        dbus_message_get_member (message) != NULL);
   _dbus_return_if_fail (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL ||
                         (dbus_message_get_interface (message) != NULL &&
                          dbus_message_get_member (message) != NULL));
@@ -2533,6 +2532,36 @@
   return NULL;
 }
 
+static dbus_bool_t
+check_for_reply_and_update_dispatch_unlocked (DBusPendingCall *pending)
+{
+  DBusMessage *reply;
+  DBusDispatchStatus status;
+  DBusConnection *connection;
+
+  connection = pending->connection;
+
+  reply = check_for_reply_unlocked (connection, pending->reply_serial);
+  if (reply != NULL)
+    {
+      _dbus_verbose ("%s checked for reply\n", _DBUS_FUNCTION_NAME);
+
+      _dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n");
+
+      _dbus_pending_call_complete_and_unlock (pending, reply);
+      dbus_message_unref (reply);
+
+      CONNECTION_LOCK (connection);
+      status = _dbus_connection_get_dispatch_status_unlocked (connection);
+      _dbus_connection_update_dispatch_status_and_unlock (connection, status);
+      dbus_pending_call_unref (pending);
+
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
 /**
  * When a function that blocks has been called with a timeout, and we
  * run out of memory, the time to wait for memory is based on the
@@ -2616,6 +2645,11 @@
                  start_tv_sec, start_tv_usec,
                  end_tv_sec, end_tv_usec);
 
+  /* check to see if we already got the data off the socket */
+  /* from another blocked pending call */
+  if (check_for_reply_and_update_dispatch_unlocked (pending))
+    return;
+
   /* Now we wait... */
   /* always block at least once as we know we don't have the reply yet */
   _dbus_connection_do_iteration_unlocked (connection,
@@ -2645,27 +2679,8 @@
     }
   
   if (status == DBUS_DISPATCH_DATA_REMAINS)
-    {
-      DBusMessage *reply;
-      
-      reply = check_for_reply_unlocked (connection, client_serial);
-      if (reply != NULL)
-        {
-          _dbus_verbose ("%s checked for reply\n", _DBUS_FUNCTION_NAME);
-
-          _dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n");
-          
-          _dbus_pending_call_complete_and_unlock (pending, reply);
-          dbus_message_unref (reply);
-
-          CONNECTION_LOCK (connection);
-          status = _dbus_connection_get_dispatch_status_unlocked (connection);
-          _dbus_connection_update_dispatch_status_and_unlock (connection, status);
-          dbus_pending_call_unref (pending);
-          
-          return;
-        }
-    }
+    if (check_for_reply_and_update_dispatch_unlocked (pending))
+      return;  
   
   _dbus_get_current_time (&tv_sec, &tv_usec);
   
@@ -2874,8 +2889,6 @@
   DBusDispatchStatus dstatus;
   dbus_bool_t dispatched_disconnected;
   
-  _dbus_return_val_if_fail (connection != NULL, FALSE);
-  _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
   dstatus = dbus_connection_get_dispatch_status (connection);
 
   if (dispatch && dstatus == DBUS_DISPATCH_DATA_REMAINS)
@@ -2947,6 +2960,8 @@
 dbus_connection_read_write_dispatch (DBusConnection *connection,
                                      int             timeout_milliseconds)
 {
+  _dbus_return_val_if_fail (connection != NULL, FALSE);
+  _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
    return _dbus_connection_read_write_dispatch(connection, timeout_milliseconds, TRUE);
 }
 
@@ -2970,6 +2985,8 @@
 dbus_connection_read_write (DBusConnection *connection, 
                             int             timeout_milliseconds) 
 { 
+  _dbus_return_val_if_fail (connection != NULL, FALSE);
+  _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
    return _dbus_connection_read_write_dispatch(connection, timeout_milliseconds, FALSE);
 }
 


Index: dbus.spec
===================================================================
RCS file: /cvs/dist/rpms/dbus/devel/dbus.spec,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- dbus.spec	17 Apr 2006 22:16:40 -0000	1.75
+++ dbus.spec	25 Apr 2006 18:33:13 -0000	1.76
@@ -49,6 +49,7 @@
 Patch1: dbus-0.32-selinux_chroot_workaround.patch
 Patch2: dbus-0.61-selinux-avc-audit.patch
 Patch3: dbus-0.60-start-early.patch
+Patch4: dbus-0.61.dbus-connection.c.backport.patch
 
 #make sure we take this out if ABI changes
 Patch4: dbus-0.61-mono-no-abi-version-change.patch 
@@ -138,6 +139,7 @@
 %patch1 -p1 -b .selinux_chroot_workaround
 %patch2 -p1 -b .selinux-avc-audit
 %patch3 -p1 -b .start-early
+%patch4 -p1 -b .backport
 
 #make sure we take this out if ABI changes
 %patch4 -p1 -b .mono-no-abi-version-change
@@ -342,6 +344,11 @@
 %endif
 
 %changelog
+* Tue Apr 25 2006 John (J5) Palmieri <johnp at redhat.com> - 0.61-4
+- Backport patch from dbus-connection.c
+  - Allows interfaces to be NULL in the message header as per the spec
+  - Fixes a problem with pendings calls blocking on a data starved socket
+
 * Mon Apr 17 2006 John (J5) Palmieri <johnp at redhat.com> 0.61-4
 - New audit patch
 




More information about the fedora-cvs-commits mailing list