Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t RFC] lib/igt_chamelium: Use curl timeout for xmlrpc calls
@ 2020-09-24 12:36 Petri Latvala
  2020-09-24 13:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Petri Latvala @ 2020-09-24 12:36 UTC (permalink / raw)
  To: igt-dev; +Cc: Kunal Joshi, Petri Latvala

Use of timeouts everywhere is meaningless if xmlrpc calls are allowed
to be blocking forever.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Cc: Arkadiusz Hiler <arek@hiler.eu>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 lib/igt_chamelium.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index d9fab902..eac893a6 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -2427,11 +2427,21 @@ void chamelium_deinit_rpc_only(struct chamelium *chamelium)
 struct chamelium *chamelium_init_rpc_only(void)
 {
 	struct chamelium *chamelium = malloc(sizeof(struct chamelium));
+	struct xmlrpc_clientparms clientparms;
+	struct xmlrpc_curl_xportparms curlparms;
 
 	if (!chamelium)
 		return NULL;
 
 	memset(chamelium, 0, sizeof(*chamelium));
+	memset(&clientparms, 0, sizeof(clientparms));
+	memset(&curlparms, 0, sizeof(curlparms));
+
+	curlparms.timeout = _RECEIVER_RESPONSIVE_AFTER_RESET_SECONDS;
+
+	clientparms.transport = "curl";
+	clientparms.transportparmsP = &curlparms;
+	clientparms.transportparm_size = XMLRPC_CXPSIZE(timeout);
 
 	chamelium->drm_fd = -1;
 
@@ -2439,7 +2449,7 @@ struct chamelium *chamelium_init_rpc_only(void)
 	xmlrpc_env_init(&chamelium->env);
 	xmlrpc_client_setup_global_const(&chamelium->env);
 	xmlrpc_client_create(&chamelium->env, XMLRPC_CLIENT_NO_FLAGS, PACKAGE,
-			     PACKAGE_VERSION, NULL, 0, &chamelium->client);
+			     PACKAGE_VERSION, &clientparms, 0, &chamelium->client);
 	if (chamelium->env.fault_occurred) {
 		igt_debug("Failed to init xmlrpc: %s\n",
 			  chamelium->env.fault_string);
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-24 16:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-24 12:36 [igt-dev] [PATCH i-g-t RFC] lib/igt_chamelium: Use curl timeout for xmlrpc calls Petri Latvala
2020-09-24 13:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-09-24 13:25 ` [igt-dev] [PATCH i-g-t RFC] " Juha-Pekka Heikkila
2020-09-24 13:36   ` Petri Latvala
2020-09-24 13:40     ` Juha-Pekka Heikkila
2020-09-24 13:38   ` Juha-Pekka Heikkila
2020-09-24 13:58     ` Petri Latvala
2020-09-24 16:56 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox