BUG: write call was replaced by a read call
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Thu, 2 Jul 2009 18:40:41 +0000 (15:40 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Thu, 2 Jul 2009 18:40:41 +0000 (15:40 -0300)
Instead of writing, we were reading from the socket. Fix it.

ssl_server.c

index 3397ae1..3686ec0 100644 (file)
@@ -60,8 +60,8 @@ ssl_push (gnutls_transport_ptr_t ptr, const void *buffer, size_t len)
   int r;
   if (ssl->handshaking == TRUE)
     {
-      r = hc_conn_read (hook->conn, buffer, len);
-      return r;
+      hc_conn_write (hook->conn, (void *) buffer, len);
+      return len;
     }
   hc_conn_write (hook->conn, (void *) buffer, len);
   return len;