fix the cpuworker circ-had-vanished bug (maybe)

still several (many) tls-related bugs outstanding.


svn:r454
This commit is contained in:
Roger Dingledine
2003-09-14 02:58:50 +00:00
parent 429fb381f8
commit e585dad887
8 changed files with 113 additions and 55 deletions
+2 -1
View File
@@ -421,7 +421,7 @@ tor_tls_verify(tor_tls *tls)
time_t now;
crypto_pk_env_t *r = NULL;
if (!(cert = SSL_get_peer_certificate(tls->ssl)))
return 0;
return NULL;
now = time(NULL);
if (X509_cmp_time(X509_get_notBefore(cert), &now) > 0)
@@ -453,3 +453,4 @@ tor_tls_verify(tor_tls *tls)
RSA_free(rsa);
return r;
}
+15
View File
@@ -103,6 +103,21 @@ int write_all(int fd, const void *buf, size_t count) {
return count;
}
/* a wrapper for read(2) that makes sure to read all count bytes.
* Only use if fd is a blocking socket. */
int read_all(int fd, void *buf, size_t count) {
int numread = 0;
int result;
while(numread != count) {
result = read(fd, buf+numread, count-numread);
if(result<=0)
return -1;
numread += result;
}
return count;
}
void set_socket_nonblocking(int socket)
{
#ifdef MS_WINDOWS
+1
View File
@@ -52,6 +52,7 @@ void tv_add(struct timeval *a, struct timeval *b);
int tv_cmp(struct timeval *a, struct timeval *b);
int write_all(int fd, const void *buf, size_t count);
int read_all(int fd, void *buf, size_t count);
void set_socket_nonblocking(int socket);