diff options
-rw-r--r-- | steam-mobile/steam_connection.c | 15 |
1 files changed, 15 insertions, 0 deletions
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); |