Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_con


Modified Files:
        ecore_con.c ecore_con_private.h 


Log Message:
put the read buffer back on the stack
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ecore_con.c 25 Apr 2004 15:42:57 -0000      1.26
+++ ecore_con.c 25 Apr 2004 15:52:53 -0000      1.27
@@ -668,7 +668,6 @@
 #endif
    if (svr->name) free(svr->name);
    if (svr->path) free(svr->path);
-   if (svr->read_buf) free(svr->read_buf);
    if (svr->fd_handler) ecore_main_fd_handler_del(svr->fd_handler);
    free(svr);
 }
@@ -772,12 +771,6 @@
    svr->dead = 1;
    ecore_main_fd_handler_del(svr->fd_handler);
    svr->fd_handler = NULL;
-
-   if (svr->read_buf)
-   {
-      free(svr->read_buf);
-      svr->read_buf = NULL;
-   }
 }
 
 static int
@@ -845,15 +838,13 @@
        for (;;)
          {
             int num, lost_server = 0;
+            char buf[READBUFSIZ];
 
 #if USE_OPENSSL
             if (!svr->ssl)
               {
 #endif
-                 /* FIXME: why is read_buf in the server struct now??? */
-                 /* yes play nice with ssl - WHY? */
-                 if (!svr->read_buf) svr->read_buf = malloc(READBUFSIZ);
-                 if ((num = read(svr->fd, svr->read_buf, READBUFSIZ)) < 1)
+                 if ((num = read(svr->fd, buf, READBUFSIZ)) < 1)
                    lost_server = (errno == EIO || errno == EBADF ||
                                   errno == EPIPE || errno == EINVAL ||
                                   errno == ENOSPC || num == 0); /* is num == 0 right? 
*/
@@ -861,8 +852,7 @@
               }
             else
               {
-                 if (!svr->read_buf) svr->read_buf = malloc(READBUFSIZ);
-                 num = SSL_read(svr->ssl, svr->read_buf, READBUFSIZ);
+                 num = SSL_read(svr->ssl, buf, READBUFSIZ);
                  if (num < 1)
                    {
                       ssl_err = SSL_get_error(svr->ssl, num);
@@ -899,7 +889,7 @@
             else
               {
                  inbuf = realloc(inbuf, inbuf_num + num);
-                 memcpy(inbuf + inbuf_num, svr->read_buf, num);
+                 memcpy(inbuf + inbuf_num, buf, num);
                  inbuf_num += num;
               }
          }
@@ -937,11 +927,6 @@
        _ecore_con_server_flush(svr);
      }
 
-   if (svr->read_buf)
-     {
-       free(svr->read_buf);
-       svr->read_buf = NULL;
-     }
    return 1;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con_private.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ecore_con_private.h 20 Apr 2004 11:40:44 -0000      1.5
+++ ecore_con_private.h 25 Apr 2004 15:52:53 -0000      1.6
@@ -56,9 +56,6 @@
    char              created : 1;
    char              connecting : 1;
 
-   /* put the read buffer here to play nice with OpenSSL */
-   unsigned char    *read_buf;
-
 #if USE_OPENSSL
    SSL_CTX          *ssl_ctx;
    SSL              *ssl;




-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to