this error fix is dedicated to Tommy[D] for continuing to prove that the impossible...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 9 Dec 2010 21:02:53 +0000 (21:02 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 9 Dec 2010 21:02:53 +0000 (21:02 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@55432 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con.c

index 3b7f81b..4349e26 100644 (file)
@@ -2231,14 +2231,16 @@ _ecore_con_server_flush(Ecore_Con_Server *svr)
    if (!svr->write_buf)
      return;
 
+   num = svr->write_buf_size - svr->write_buf_offset;
+
    /* check whether we need to write anything at all.
     * we must not write zero bytes with SSL_write() since it
     * causes undefined behaviour
     */
-   if (svr->write_buf_size == svr->write_buf_offset)
-     return;
-
-   num = svr->write_buf_size - svr->write_buf_offset;
+   /* we thank Tommy[D] for needing to check negative buffer sizes
+    * here because his system is amazing.
+    */
+   if (num <= 0) return;
 
    if (svr->handshaking)
      {