retry curl without `--continue-at -` flag (#95629)

diff --git a/bin/internal/update_dart_sdk.sh b/bin/internal/update_dart_sdk.sh
index 148f46c..6f07d75 100755
--- a/bin/internal/update_dart_sdk.sh
+++ b/bin/internal/update_dart_sdk.sh
@@ -116,6 +116,21 @@
   fi
 
   curl ${verbose_curl} --retry 3 --continue-at - --location --output "$DART_SDK_ZIP" "$DART_SDK_URL" 2>&1 || {
+    curlExitCode=$?
+    # Handle range errors specially: retry again with disabled ranges (`--continue-at -` argument)
+    # When this could happen:
+    # - missing support of ranges in proxy servers
+    # - curl with broken handling of completed downloads
+    #   This is not a proper fix, but doesn't require any user input
+    # - mirror of flutter storage without support of ranges
+    #
+    # 33  HTTP range error. The range "command" didn't work.
+    # https://man7.org/linux/man-pages/man1/curl.1.html#EXIT_CODES
+    if [ $curlExitCode != 33 ]; then
+      return $curlExitCode
+    fi
+    curl ${verbose_curl} --retry 3 --location --output "$DART_SDK_ZIP" "$DART_SDK_URL" 2>&1
+  } || {
     >&2 echo
     >&2 echo "Failed to retrieve the Dart SDK from: $DART_SDK_URL"
     >&2 echo "If you're located in China, please see this page:"