2004-12-19 jrandom

* Added a new i2ptunnel type: 'httpserver', allowing you to specify what
      hostname should be sent to the webserver.  By default, new installs will
      have an httpserver pointing at their jetty instance with the spoofed
      name 'mysite.i2p' (editable on the /i2ptunnel/edit.jsp page).
This commit is contained in:
jrandom
2004-12-19 11:04:56 +00:00
committed by zzz
parent ec11ea4ca7
commit 1756997608
12 changed files with 369 additions and 24 deletions

View File

@ -680,7 +680,19 @@ public class DataHelper {
*/
public static String readLine(InputStream in) throws IOException {
StringBuffer buf = new StringBuffer(128);
boolean ok = readLine(in, buf);
if (ok)
return buf.toString();
else
return null;
}
/**
* Read in a line, placing it into the buffer (excluding the newline).
*
* @return true if the line was read, false if eof was reached before a
* newline was found
*/
public static boolean readLine(InputStream in, StringBuffer buf) throws IOException {
int c = -1;
while ( (c = in.read()) != -1) {
if (c == '\n')
@ -688,9 +700,9 @@ public class DataHelper {
buf.append((char)c);
}
if (c == -1)
return null;
return false;
else
return buf.toString();
return true;
}