From 5f4a390b337ab04da488d21ecc689a15da496d55 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Thu, 14 Oct 2004 02:48:57 +0000 Subject: [PATCH] oh, and some more in common/ svn:r2483 --- src/common/tortls.c | 8 ++++---- src/common/tortls.h | 6 +++--- src/common/util.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/tortls.c b/src/common/tortls.c index c685c12803..8a4dccaa2e 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -50,7 +50,7 @@ struct tor_tls_st { } state; /**< The current SSL state, depending on which operations have * completed successfully. */ int isServer; - int wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time. */ + size_t wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time. */ }; static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa, @@ -429,7 +429,7 @@ tor_tls_free(tor_tls *tls) * TOR_TLS_CLOSE, TOR_TLS_WANTREAD, or TOR_TLS_WANTWRITE. */ int -tor_tls_read(tor_tls *tls, char *cp, int len) +tor_tls_read(tor_tls *tls, char *cp, size_t len) { int r, err; tor_assert(tls && tls->ssl); @@ -454,7 +454,7 @@ tor_tls_read(tor_tls *tls, char *cp, int len) * TOR_TLS_WANTREAD, or TOR_TLS_WANTWRITE. */ int -tor_tls_write(tor_tls *tls, char *cp, int n) +tor_tls_write(tor_tls *tls, char *cp, size_t n) { int r, err; tor_assert(tls && tls->ssl); @@ -580,7 +580,7 @@ tor_tls_peer_has_cert(tor_tls *tls) * claims to have. */ int -tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, int buflen) +tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, size_t buflen) { X509 *cert = NULL; X509_NAME *name = NULL; diff --git a/src/common/tortls.h b/src/common/tortls.h index 3346a878e2..9b7e24d7f9 100644 --- a/src/common/tortls.h +++ b/src/common/tortls.h @@ -27,10 +27,10 @@ int tor_tls_context_new(crypto_pk_env_t *rsa, int isServer, tor_tls *tor_tls_new(int sock, int is_server, int use_no_cert); void tor_tls_free(tor_tls *tls); int tor_tls_peer_has_cert(tor_tls *tls); -int tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, int buflen); +int tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, size_t buflen); int tor_tls_verify(tor_tls *tls, crypto_pk_env_t **identity); -int tor_tls_read(tor_tls *tls, char *cp, int len); -int tor_tls_write(tor_tls *tls, char *cp, int n); +int tor_tls_read(tor_tls *tls, char *cp, size_t len); +int tor_tls_write(tor_tls *tls, char *cp, size_t n); int tor_tls_handshake(tor_tls *tls); int tor_tls_shutdown(tor_tls *tls); int tor_tls_get_pending_bytes(tor_tls *tls); diff --git a/src/common/util.c b/src/common/util.c index fb31161993..5a5fbdddaf 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1650,7 +1650,7 @@ char *read_file_to_str(const char *filename, int bin) { * that is whitespace or comment. * Return 1 if success, 0 if no more lines, -1 if error. */ -int parse_line_from_file(char *line, int maxlen, FILE *f, char **key_out, char **value_out) { +int parse_line_from_file(char *line, size_t maxlen, FILE *f, char **key_out, char **value_out) { char *s, *key, *end, *value; try_next_line: