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

[or-cvs] r10394: Move connection_should_read_from_linked_conn into main.c, wh (in tor/trunk: . src/or)



Author: nickm
Date: 2007-05-29 14:20:56 -0400 (Tue, 29 May 2007)
New Revision: 10394

Modified:
   tor/trunk/
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/or.h
Log:
 r13053@catbus:  nickm | 2007-05-29 13:35:33 -0400
 Move connection_should_read_from_linked_conn into main.c, which is the only file that uses it.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13053] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2007-05-29 17:31:13 UTC (rev 10393)
+++ tor/trunk/src/or/connection.c	2007-05-29 18:20:56 UTC (rev 10394)
@@ -2277,24 +2277,6 @@
   return 0;
 }
 
-/* XXXX020 move this into main.c */
-/** Return true iff <b>conn</b> is linked conn, and reading from the conn
- * linked to it would be good and feasible.  (Reading is "feasible" if the
- * other conn exists and has data in its outbuf, and is "good" if we have our
- * reading_from_linked_conn flag set and the other conn has its
- * writing_to_linked_conn flag set.)*/
-int
-connection_should_read_from_linked_conn(connection_t *conn)
-{
-  if (conn->linked && conn->reading_from_linked_conn) {
-    if (! conn->linked_conn ||
-        (conn->linked_conn->writing_to_linked_conn &&
-         buf_datalen(conn->linked_conn->outbuf)))
-      return 1;
-  }
-  return 0;
-}
-
 /** Allocates a base64'ed authenticator for use in http or https
  * auth, based on the input string <b>authenticator</b>. Returns it
  * if success, else returns NULL. */

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2007-05-29 17:31:13 UTC (rev 10393)
+++ tor/trunk/src/or/main.c	2007-05-29 18:20:56 UTC (rev 10394)
@@ -29,6 +29,7 @@
 static void second_elapsed_callback(int fd, short event, void *args);
 static int conn_close_if_marked(int i);
 static void connection_start_reading_from_linked_conn(connection_t *conn);
+static int connection_should_read_from_linked_conn(connection_t *conn);
 
 /********* START VARIABLES **********/
 
@@ -399,6 +400,23 @@
   }
 }
 
+/** Return true iff <b>conn</b> is linked conn, and reading from the conn
+ * linked to it would be good and feasible.  (Reading is "feasible" if the
+ * other conn exists and has data in its outbuf, and is "good" if we have our
+ * reading_from_linked_conn flag set and the other conn has its
+ * writing_to_linked_conn flag set.)*/
+static int
+connection_should_read_from_linked_conn(connection_t *conn)
+{
+  if (conn->linked && conn->reading_from_linked_conn) {
+    if (! conn->linked_conn ||
+        (conn->linked_conn->writing_to_linked_conn &&
+         buf_datalen(conn->linked_conn->outbuf)))
+      return 1;
+  }
+  return 0;
+}
+
 /** Helper: Tell the main loop to begin reading bytes into <b>conn</b> from
  * its linked connection, if it is not doing so already.  Called by
  * connection_start_reading and connection_start_writing as appropriate. */

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-05-29 17:31:13 UTC (rev 10393)
+++ tor/trunk/src/or/or.h	2007-05-29 18:20:56 UTC (rev 10394)
@@ -2357,7 +2357,6 @@
 int connection_is_listener(connection_t *conn);
 int connection_state_is_open(connection_t *conn);
 int connection_state_is_connecting(connection_t *conn);
-int connection_should_read_from_linked_conn(connection_t *conn);
 
 char *alloc_http_authenticator(const char *authenticator);