[or-cvs] r12775: Fix a few minor compilation bugs (tor/branches/urz-bufferevents/src/or)

Urz at seul.org Urz at seul.org
Wed Dec 12 00:48:27 UTC 2007


Author: Urz
Date: 2007-12-11 19:48:26 -0500 (Tue, 11 Dec 2007)
New Revision: 12775

Modified:
   tor/branches/urz-bufferevents/src/or/connection.c
   tor/branches/urz-bufferevents/src/or/eventdns.c
   tor/branches/urz-bufferevents/src/or/or.h
Log:
Fix a few minor compilation bugs

Modified: tor/branches/urz-bufferevents/src/or/connection.c
===================================================================
--- tor/branches/urz-bufferevents/src/or/connection.c	2007-12-11 23:23:25 UTC (rev 12774)
+++ tor/branches/urz-bufferevents/src/or/connection.c	2007-12-12 00:48:26 UTC (rev 12775)
@@ -195,7 +195,7 @@
   conn->s = -1; /* give it a default of 'not used' */
   conn->conn_array_index = -1; /* also default to 'not used' */
   
-  conn->bufev = NULL  
+  conn->bufev = NULL; 
 
   conn->type = type;
   conn->socket_family = socket_family;
@@ -1946,7 +1946,7 @@
   } else {
     /* !connection_speaks_cells, !conn->linked_conn. */
     if(conn->type == CONN_TYPE_DIR) { 
-      copybuf = tor_malloc(max_to_write);
+      copybuf = tor_malloc(max_to_read);
       result = bufferevent_read(conn->bufev, copybuf, at_most);
       //fetch_from_buf(copybuf, max_to_write, conn->outbuf);
       

Modified: tor/branches/urz-bufferevents/src/or/eventdns.c
===================================================================
--- tor/branches/urz-bufferevents/src/or/eventdns.c	2007-12-11 23:23:25 UTC (rev 12774)
+++ tor/branches/urz-bufferevents/src/or/eventdns.c	2007-12-12 00:48:26 UTC (rev 12775)
@@ -1039,10 +1039,10 @@
 static u16
 transaction_id_pick(void) {
 	for (;;) {
+        u16 trans_id;
 		const struct request *req = req_head, *started_at;
 #ifdef DNS_USE_CPU_CLOCK_FOR_ID
 		struct timespec ts;
-		u16 trans_id;
 #ifdef CLOCK_MONOTONIC
 		if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
 #else
@@ -1054,13 +1054,11 @@
 
 #ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
 		struct timeval tv;
-		u16 trans_id;
 		gettimeofday(&tv, NULL);
 		trans_id = tv.tv_usec & 0xffff;
 #endif
 
 #ifdef DNS_USE_OPENSSL_FOR_ID
-		u16 trans_id;
 		if (RAND_pseudo_bytes((u8 *) &trans_id, 2) == -1) {
 			/* // in the case that the RAND call fails we back
 			// down to using gettimeofday.

Modified: tor/branches/urz-bufferevents/src/or/or.h
===================================================================
--- tor/branches/urz-bufferevents/src/or/or.h	2007-12-11 23:23:25 UTC (rev 12774)
+++ tor/branches/urz-bufferevents/src/or/or.h	2007-12-12 00:48:26 UTC (rev 12775)
@@ -783,7 +783,7 @@
    * stop requiring it. */
   unsigned int chosen_exit_optional:1;
 
-  bufferevent *bufev; /**< Bufferevent for connection types which have been converted */
+  struct bufferevent *bufev; /**< Bufferevent for connection types which have been converted */
   int s; /**< Our socket; -1 if this connection is closed, or has no
           * socket. */
   int conn_array_index; /**< Index into the global connection array. */



More information about the tor-commits mailing list