diff options
author | Eion Robb <eion@robbmob.com> | 2018-06-19 13:58:58 +0300 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2018-06-19 13:58:58 +0300 |
commit | 15a6528d7a31189a19d9eef96655326ada210bf4 (patch) | |
tree | 395ae4dd3a2bb7390861826de45fa7920c4a3617 | |
parent | 0eb3d9241bd483c8053630d022edf9621bea30d5 (diff) |
Try to re-request any rate-limited responses
-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); |