[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Add a macro to catch unhandled openssl errors.



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv30542/src/or

Modified Files:
	buffers.c 
Log Message:
Add a macro to catch unhandled openssl errors.

Index: buffers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/buffers.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- buffers.c	26 Apr 2004 22:22:18 -0000	1.81
+++ buffers.c	26 Apr 2004 23:00:07 -0000	1.82
@@ -221,7 +221,7 @@
          tor_tls_get_pending_bytes(tls), at_most);
 
   if (buf_ensure_capacity(buf, at_most+buf->datalen))
-    return -1;
+    return TOR_TLS_ERROR;
 
   if (at_most > buf->len - buf->datalen)
     at_most = buf->len - buf->datalen;
@@ -231,6 +231,8 @@
 
   log_fn(LOG_DEBUG,"before: %d on buf, %d pending, at_most %d.",(int)buf_datalen(buf),
          tor_tls_get_pending_bytes(tls), at_most);
+
+  assert_no_tls_errors();
   r = tor_tls_read(tls, buf->mem+buf->datalen, at_most);
   if (r<0)
     return r;