[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Note discrepency between N bytes transmitted over TLS and a...
- To: or-cvs@freehaven.net
- Subject: [or-cvs] Note discrepency between N bytes transmitted over TLS and a...
- From: nickm@seul.org (Nick Mathewson)
- Date: Mon, 12 Jan 2004 20:19:09 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Mon, 12 Jan 2004 20:19:37 -0500
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv2673/src/common
Modified Files:
tortls.c tortls.h
Log Message:
Note discrepency between N bytes transmitted over TLS and actual bandwidth use; add 2 functions to help resolve.
Index: tortls.c
===================================================================
RCS file: /home/or/cvsroot/src/common/tortls.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- tortls.c 17 Dec 2003 21:14:13 -0000 1.33
+++ tortls.c 13 Jan 2004 01:19:02 -0000 1.34
@@ -52,7 +52,6 @@
#define _TOR_TLS_SYSCALL -6
#define _TOR_TLS_ZERORETURN -5
-
/* These functions are declared in crypto.c but not exported. */
EVP_PKEY *_crypto_pk_env_get_evp_pkey(crypto_pk_env_t *env);
crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa);
@@ -571,3 +570,15 @@
assert(tls);
return SSL_pending(tls->ssl);
}
+
+/* Return the number of bytes read across the underlying socket. */
+unsigned long tor_tls_get_n_bytes_read(tor_tls *tls)
+{
+ assert(tls);
+ return BIO_number_read(SSL_get_rbio(tls->ssl));
+}
+unsigned long tor_tls_get_n_bytes_written(tor_tls *tls)
+{
+ assert(tls);
+ return BIO_number_written(SSL_get_wbio(tls->ssl));
+}
Index: tortls.h
===================================================================
RCS file: /home/or/cvsroot/src/common/tortls.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- tortls.h 19 Oct 2003 00:46:51 -0000 1.9
+++ tortls.h 13 Jan 2004 01:19:02 -0000 1.10
@@ -29,4 +29,7 @@
int tor_tls_shutdown(tor_tls *tls);
int tor_tls_get_pending_bytes(tor_tls *tls);
+unsigned long tor_tls_get_n_bytes_read(tor_tls *tls);
+unsigned long tor_tls_get_n_bytes_written(tor_tls *tls);
+
#endif