给lftp报了一个bug

学校用的proftpd,为了照顾windows用户,设置了UseEncoding GBK GBK
这样,proftpd返回的FEAT里面,有LANG,没有UTF8。
但是lftp只要知道服务器支持LANG,就会发个LANG过去。只要收到LANG的回复,就认为服务器用的UTF-8……
虽然LANG和UTF8都是RFC 2640定义的,但是支持LANG不一定就是UTF8啊……
所以发了个patch给作者,不知道他会不会管……
— src/ftpclass.cc.orig        2010-04-29 17:20:28.000000000 +0800
+++ src/ftpclass.cc     2010-04-29 17:20:42.000000000 +0800
@@ -4100,8 +4100,11 @@
    case Expect::LANG:
       if(is2XX(act))
       {
–        conn->utf8_activated=true;
–        conn->SetControlConnectionTranslation(“UTF-8”);
+                 if (conn->utf8_supported)
+                 {
+                         conn->utf8_activated=true;
+                         conn->SetControlConnectionTranslation(“UTF-8”);
+                 }
       }
       else if(act==530)
         conn->tune_after_login=true;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.