From 15a6528d7a31189a19d9eef96655326ada210bf4 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Tue, 19 Jun 2018 22:58:58 +1200 Subject: Try to re-request any rate-limited responses --- steam-mobile/steam_connection.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/steam-mobile/steam_connection.c b/steam-mobile/steam_connection.c index 69998a1..2f845c3 100644 --- a/steam-mobile/steam_connection.c +++ b/steam-mobile/steam_connection.c @@ -216,6 +216,21 @@ static void steam_connection_process_data(SteamConnection *steamcon) g_free(tmp); tmp = gunzipped; } + + if (strstr(steamcon->rx_buf, "429 Too Many Requests")) { + g_free(steamcon->rx_buf); + steamcon->rx_buf = NULL; + g_free(tmp); + + //We got rate-limited, try again + SteamConnection *steamcon_dup = g_memdup(steamcon, sizeof(steamcon)); + steamcon_dup->request = steamcon->request; steamcon->request = NULL; + steamcon_dup->url = steamcon->url; steamcon->url = NULL; + steamcon_dup->hostname = steamcon->hostname; steamcon->hostname = NULL; + + g_queue_push_head(steamcon->sa->waiting_conns, steamcon_dup); + return; + } } g_free(steamcon->rx_buf); -- cgit v1.2.3