On Mon, Jan 21, 2002 at 07:13:41PM +0100, Kjartan ?s??rsson wrote:
>  I did setup a test server at:

Thanks! I was able to reproduce and fix the problem. It turned out that
openssl library expected a fixed buffer from which program did SSL_write's.
Fortunately there is a flag to turn it off. BTW I have fixed another
problem with ssl, which could cause casual cpu spinning.

You can try attached patch.

-- 
   Alexander.                      | http://www.yars.free.net/~lav/  
Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.233
diff -u -r1.233 ftpclass.cc
--- ftpclass.cc 2002/01/10 09:58:08     1.233
+++ ftpclass.cc 2002/01/22 08:26:42
@@ -2039,6 +2039,13 @@
 notimeout_return:
    if(m==MOVED)
       return MOVED;
+#ifdef USE_SSL
+   if(data_ssl)
+   {
+      BlockOnSSL(data_ssl);
+   }
+   else
+#endif
    if(data_sock!=-1)
    {
       if(state==ACCEPTING_STATE)
@@ -2068,6 +2075,13 @@
         abort();
       }
    }
+#ifdef USE_SSL
+   if(control_ssl)
+   {
+      BlockOnSSL(control_ssl);
+   }
+   else
+#endif
    if(control_sock!=-1)
    {
       if(state==CONNECTING_STATE)
@@ -3120,9 +3134,8 @@
            BlockOnSSL(control_ssl);
            return DO_AGAIN;
         }
-        if(NotSerious(errno))
-           DebugPrint("**** ",strerror(errno),0);
-        else
+        DebugPrint("**** ",strerror(errno),0);
+        if(!NotSerious(errno))
            SetError(SEE_ERRNO,"SSL_write(data_ssl)");
         quit_sent=true;
         Disconnect();
Index: lftp_ssl.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/lftp_ssl.cc,v
retrieving revision 1.2
diff -u -r1.2 lftp_ssl.cc
--- lftp_ssl.cc 2000/08/03 22:55:58     1.2
+++ lftp_ssl.cc 2002/01/22 08:26:34
@@ -75,6 +75,7 @@
    lftp_ssl_ctx_init();
    SSL *ssl=SSL_new(ssl_ctx);
    SSL_set_fd(ssl,fd);
+   SSL_ctrl(ssl,SSL_CTRL_MODE,SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER,0);
    return ssl;
 }
 

Reply via email to