forked from I2P_Developers/i2p.i2p
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:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user