[or-cvs] [puppetor/master] On client side, read the full response, not just the first byte.

karsten at seul.org karsten at seul.org
Tue Jul 28 19:13:04 UTC 2009


Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Tue, 28 Jul 2009 21:11:10 +0200
Subject: On client side, read the full response, not just the first byte.
Commit: 33d63a5708ecf6b835fb626b41759d9d22f6bc2b

---
 .../puppetor/impl/ClientApplicationImpl.java       |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/org/torproject/puppetor/impl/ClientApplicationImpl.java b/src/org/torproject/puppetor/impl/ClientApplicationImpl.java
index de44bdf..0ddf854 100644
--- a/src/org/torproject/puppetor/impl/ClientApplicationImpl.java
+++ b/src/org/torproject/puppetor/impl/ClientApplicationImpl.java
@@ -155,9 +155,12 @@ public class ClientApplicationImpl extends UnicastRemoteObject implements
                         BufferedReader in = new BufferedReader(
                                 new InputStreamReader(s.getInputStream()));
 
-                        // only read the first char in the response; this method
-                        // blocks until there is a response
-                        in.read();
+                        // read the response
+                        String line = null;
+                        StringBuilder response = new StringBuilder();
+                        while ((line = in.readLine()) != null) {
+                            response.append(line + "\n");
+                        }
 
                         // send event to event manager
                         eventManager.observeInternalEvent(System
@@ -165,7 +168,7 @@ public class ClientApplicationImpl extends UnicastRemoteObject implements
                                 ClientApplicationImpl.this
                                         .getClientApplicationName(),
                                 ClientEventType.CLIENT_REPLY_RECEIVED,
-                                "Received response.");
+                                "Received response: " + response.toString());
 
                         // if we should stop on success, stop further connection
                         // attempts
-- 
1.5.6.5




More information about the tor-commits mailing list