[-]
[+]
|
Changed |
_service:tar_git:libgiorpc.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://git.monich.net/git/libgiorpc.git</param>
<param name="branch">master</param>
- <param name="revision">3457b8e</param>
+ <param name="revision">223e142</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:libgiorpc-1.0.0+master.20240112190628.223e142.tar.bz2/include/giorpc_peer.h
^
|
@@ -167,8 +167,8 @@
* invocation. In other words, synchronizes the function with other callbacks
* invoked by GIoRpcPeer. The function can be either called directly or
* scheduled as an idle. If the peer is destroyed before the function has
- * a chance to be invoked, the function isn't called. The notify callback
- * (if specified) is called in any case.
+ * a chance to be invoked, the function isn't called. The destroy callback
+ * (if provided) is called in any case.
*/
void
giorpc_peer_invoke(
@@ -203,7 +203,8 @@
/*
* giorpc_peer_call() returns non-zero call id which can be passed to
* giorpc_peer_cancel() or zero on failure. Implicitly starts the peer
- * if it's not started yet.
+ * if it's not started yet. The destroy callback (if provided) is always
+ * called even if giorpc_peer_call() fails or the call was cancelled.
*/
guint
giorpc_peer_call(
|
[-]
[+]
|
Changed |
_service:tar_git:libgiorpc-1.0.0+master.20240112190628.223e142.tar.bz2/src/giorpc_peer.c
^
|
@@ -2814,7 +2814,6 @@
giorpc_peer_request_locked(self, call, data);
} else {
giorpc_peer_call_drop(self, call->id);
- call->destroy = NULL;
call->response = NULL;
}
g_main_context_release(self->context);
@@ -2827,6 +2826,8 @@
giorpc_peer_request_data_new(call, data));
}
}
+ } else if (destroy) {
+ destroy(user_data);
}
return id;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libgiorpc-1.0.0+master.20240112190628.223e142.tar.bz2/unit/test_peer/test_peer.c
^
|
@@ -505,7 +505,7 @@
test_null()
{
GError* error = NULL;
- int count = 0;
+ int n = 0;
g_assert(!giorpc_peer_new(NULL, NULL));
g_assert(!giorpc_peer_add_state_handler(NULL, NULL, NULL));
@@ -537,8 +537,12 @@
giorpc_request_unref(NULL);
/* giorpc_peer_invoke withough an object still calls the destroy callback */
- giorpc_peer_invoke(NULL, test_no_peer_callback, &count, test_inc_destroy);
- g_assert_cmpint(count, == ,1);
+ giorpc_peer_invoke(NULL, test_no_peer_callback, &n, test_inc_destroy);
+ g_assert_cmpint(n, == ,1);
+
+ /* giorpc_peer_call() does the same */
+ g_assert(!giorpc_peer_call(NULL, 0, 0, NULL, NULL, &n, test_inc_destroy));
+ g_assert_cmpint(n, == ,2);
}
/*==========================================================================*
|