Browse code

avformat/ftp: allow nonstandard 202 reply to OPTS UTF8

Fixes ticket #7481.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 8e5a2495a8dad262e0a00fbca09b7779b4ebf0bf)

Marton Balint authored on 2018/11/02 05:03:59
Showing 1 changed files
... ...
@@ -513,7 +513,7 @@ static int ftp_features(FTPContext *s)
513 513
     static const char *feat_command        = "FEAT\r\n";
514 514
     static const char *enable_utf8_command = "OPTS UTF8 ON\r\n";
515 515
     static const int feat_codes[] = {211, 0};
516
-    static const int opts_codes[] = {200, 451, 0};
516
+    static const int opts_codes[] = {200, 202, 451, 0};
517 517
 
518 518
     av_freep(&s->features);
519 519
     if (ftp_send_command(s, feat_command, feat_codes, &s->features) != 211) {
... ...
@@ -521,7 +521,8 @@ static int ftp_features(FTPContext *s)
521 521
     }
522 522
 
523 523
     if (ftp_has_feature(s, "UTF8")) {
524
-        if (ftp_send_command(s, enable_utf8_command, opts_codes, NULL) == 200)
524
+        int ret = ftp_send_command(s, enable_utf8_command, opts_codes, NULL);
525
+        if (ret == 200 || ret == 202)
525 526
             s->utf8 = 1;
526 527
     }
527 528