[ENBD] problem of ssl

Peter T. Breuer ptb@oboe.it.uc3m.es
Sat, 13 Jan 2001 13:11:09 +0100 (MET)


"A month of sundays ago Peter T. Breuer wrote:"
> "A month of sundays ago EO2Y wrote:"
> > I download the nbd-2.2.29 and make test of it with using ssl.It still does not work. And the certificates also get built correctly. 
> 
> To follow up. 2.2.26 is alright wrt SSL. 2.2.27 is not.
> 
> Now to look at the diffs (groan).


The following move of an fcntl by 7 lines broke SSL in 2.2.27.
*Reversing* it fixes SSL in 2.2.27. You should be able to port the
unchange forward to 2.29. I'll try it later.

No, I don't know why this broke only SSL. Looks harmless.

Peter


diff -ur nbd-2.2.26/nbd/nbd-server.c nbd-2.2.27/nbd/nbd-server.c
--- nbd-2.2.26/nbd/nbd-server.c	Mon Aug 21 22:37:40 2000
+++ nbd-2.2.27/nbd/nbd-server.c	Wed Aug 23 22:35:52 2000
@@ -485,10 +487,6 @@
         goto fail;
       }
 
-      if (fcntl(self->sock,F_SETFL,O_NONBLOCK) < 0) {
-        MSG("warning: fcntl NONBLOCK failed with %m\n");
-      }
-
       DEBUG("accept, ");
       self->sock = accept(self->socket, (struct sockaddr *) &addrin, &addrinlen);
       if (self->sock < 0) {
@@ -497,6 +495,10 @@
         goto fail;
       }
 
+      if (fcntl(self->sock,F_SETFL,O_NONBLOCK) < 0) {
+        MSG("warning: fcntl NONBLOCK failed with %m\n");
+      }
+
       printf("server opened port #%d\n",self->port);
       return self->sock;