|
Lines 2533-2538
Link Here
|
| 2533 |
return NULL; |
2533 |
return NULL; |
| 2534 |
} |
2534 |
} |
| 2535 |
|
2535 |
|
|
|
2536 |
static dbus_bool_t |
| 2537 |
check_for_reply_and_update_dispatch_unlocked (DBusPendingCall *pending) |
| 2538 |
{ |
| 2539 |
DBusMessage *reply; |
| 2540 |
DBusDispatchStatus status; |
| 2541 |
DBusConnection *connection; |
| 2542 |
|
| 2543 |
connection = pending->connection; |
| 2544 |
|
| 2545 |
reply = check_for_reply_unlocked (connection, pending->reply_serial); |
| 2546 |
if (reply != NULL) |
| 2547 |
{ |
| 2548 |
_dbus_verbose ("%s checked for reply\n", _DBUS_FUNCTION_NAME); |
| 2549 |
|
| 2550 |
_dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n"); |
| 2551 |
|
| 2552 |
_dbus_pending_call_complete_and_unlock (pending, reply); |
| 2553 |
dbus_message_unref (reply); |
| 2554 |
|
| 2555 |
CONNECTION_LOCK (connection); |
| 2556 |
status = _dbus_connection_get_dispatch_status_unlocked (connection); |
| 2557 |
_dbus_connection_update_dispatch_status_and_unlock (connection, status); |
| 2558 |
dbus_pending_call_unref (pending); |
| 2559 |
|
| 2560 |
return TRUE; |
| 2561 |
} |
| 2562 |
|
| 2563 |
return FALSE; |
| 2564 |
} |
| 2565 |
|
| 2536 |
/** |
2566 |
/** |
| 2537 |
* When a function that blocks has been called with a timeout, and we |
2567 |
* When a function that blocks has been called with a timeout, and we |
| 2538 |
* run out of memory, the time to wait for memory is based on the |
2568 |
* run out of memory, the time to wait for memory is based on the |
|
Lines 2616-2621
Link Here
|
| 2616 |
start_tv_sec, start_tv_usec, |
2646 |
start_tv_sec, start_tv_usec, |
| 2617 |
end_tv_sec, end_tv_usec); |
2647 |
end_tv_sec, end_tv_usec); |
| 2618 |
|
2648 |
|
|
|
2649 |
/* check to see if we already got the data off the socket */ |
| 2650 |
/* from another blocked pending call */ |
| 2651 |
if (check_for_reply_and_update_dispatch_unlocked (pending)) |
| 2652 |
return; |
| 2653 |
|
| 2619 |
/* Now we wait... */ |
2654 |
/* Now we wait... */ |
| 2620 |
/* always block at least once as we know we don't have the reply yet */ |
2655 |
/* always block at least once as we know we don't have the reply yet */ |
| 2621 |
_dbus_connection_do_iteration_unlocked (connection, |
2656 |
_dbus_connection_do_iteration_unlocked (connection, |
|
Lines 2645-2671
Link Here
|
| 2645 |
} |
2680 |
} |
| 2646 |
|
2681 |
|
| 2647 |
if (status == DBUS_DISPATCH_DATA_REMAINS) |
2682 |
if (status == DBUS_DISPATCH_DATA_REMAINS) |
| 2648 |
{ |
2683 |
if (check_for_reply_and_update_dispatch_unlocked (pending)) |
| 2649 |
DBusMessage *reply; |
2684 |
return; |
| 2650 |
|
|
|
| 2651 |
reply = check_for_reply_unlocked (connection, client_serial); |
| 2652 |
if (reply != NULL) |
| 2653 |
{ |
| 2654 |
_dbus_verbose ("%s checked for reply\n", _DBUS_FUNCTION_NAME); |
| 2655 |
|
| 2656 |
_dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n"); |
| 2657 |
|
| 2658 |
_dbus_pending_call_complete_and_unlock (pending, reply); |
| 2659 |
dbus_message_unref (reply); |
| 2660 |
|
| 2661 |
CONNECTION_LOCK (connection); |
| 2662 |
status = _dbus_connection_get_dispatch_status_unlocked (connection); |
| 2663 |
_dbus_connection_update_dispatch_status_and_unlock (connection, status); |
| 2664 |
dbus_pending_call_unref (pending); |
| 2665 |
|
| 2666 |
return; |
| 2667 |
} |
| 2668 |
} |
| 2669 |
|
2685 |
|
| 2670 |
_dbus_get_current_time (&tv_sec, &tv_usec); |
2686 |
_dbus_get_current_time (&tv_sec, &tv_usec); |
| 2671 |
|
2687 |
|