-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.1.6, 1.1.7, 1.2.0
-
generic, x86
-
generic, windows_95, windows_nt
ring sServer = "Server> ";
private static String sClient = "Client> ";
private static String sProxy = "Proxy > ";
private static String sSpace = " ";
public FtpProxy (Socket skControlClient) {
this.skControlClient = skControlClient;
}
public void run() {
String sFromClient, sFromServer;
ccControl = new ControlConnect();
try {
brClient = new BufferedReader(new InputStreamReader(skControlClient.getInputStream()));
pwClient = new PrintWriter(skControlClient.getOutputStream(), true);
byte b[] = skControlClient.getLocalAddress().getAddress();
sLocalIP = (0xff & b[3]) + "," + (0xff & b[2]) + ',' + (0xff & b[1]) + ',' + (0xff & b[0]);
sFromServer = "220 Java FTP Proxy Server (usage: USERID=user@site) ready.";
pwClient.println(sFromServer);
System.out.println(sProxy + sFromServer);
sFromClient = brClient.readLine(); //should be "user@site"
System.out.println(sClient + sFromClient);
int i = sFromClient.indexOf('@');
if (i <= 5 || i + 4 >= sFromClient.length() || sFromClient.indexOf('.', i) == -1) {
//simple validation af input
sFromServer = "531 Incorrect usage - closing connection.";
System.out.println(sProxy + sFromServer);
pwClient.println(sFromServer);
skControlClient.close();
return;
}
String sUser = sFromClient.substring(0,i);
String sServerHost = sFromClient.substring(i+1);
System.out.println("Connecting to " + sServerHost + " on port 21");
Socket skControlServer = new Socket(sServerHost, 21);
brServer = new BufferedReader(new InputStreamReader(skControlServer.getInputStream()));
pwServer = new PrintWriter(skControlServer.getOutputStream(), true);
pwServer.println(sUser); //USER user
System.out.println(sProxy + sUser);
skControlClient.setSoTimeout(iSOTIMEOUT);
skControlServer.setSoTimeout(iSOTIMEOUT);
ccControl.start();
} catch (Exception e) {
try {
sFromServer = "421 Internal error, closing connection.";
System.out.println(sProxy + sFromServer + e.toString());
pwClient.println(sFromServer);
} catch (Exception ioe) {}
ccControl.close();
}
}
public static void main (String args[]) {
int port = 8089;
try {
if (args.length == 1)
port = Integer.parseInt(args[0]);
else if (args.length > 1)
System.out.println("Usage: java FtpProxy [port]");
} catch (NumberFormatException e) {}
try {
ServerSocket ssControlClient = new ServerSocket(port);
System.out.println("Listening on port " + port);
while (true) {
Socket skControlClient = ssControlClient.accept();
System.out.println("New connection");
new FtpProxy(skControlClient).start();
}
} catch (IOException ioe) {
System.out.println(ioe.toString());
}
}
public class ControlConnect extends Thread {
private boolean bClosed = false;
private boolean bIgnoreServer = true;
private String readLine(BufferedReader br) throws IOException {
while (!bClosed)
try {
return br.readLine();
} catch (InterruptedIOException iioe) {}
throw new IOException();
}
private synchronized void fromServer(String sFS) throws IOException {
String sFromClient, sFromServer = sFS;
if (!bIgnoreServer) pwClient.println(sFromServer);
System.out.println(sServer + sFromServer);
if (sFromServer.charAt(3) != '-') bIgnoreServer = false;
}
private synchronized void fromClient(String sFC) throws IOException {
String sFromServer, sFromClient = sFC;
if (sFromClient == null) {
close();
return;
} else if (sFromClient.toUpperCase().startsWith("PASS")) {
pwServer.println(sFromClient);
System.out.println(sClient + "PASS *****");
} else if (sFromClient.toUpperCase().startsWith("PASV")) {
System.out.println(sClient + sFromClient);
try {if (ssDataClient != null) ssDataClient.close();} catch (IOException ioe) {}
try {if (skDataClient != null) skDataClient.close();} catch (IOException ioe) {}
try {if (ssDataServer != null) ssDataServer.close();} catch (IOException ioe) {}
if (dcData != null) dcData.close();
skDataClient = null;
ssDataClient = new ServerSocket(0);
int iPort = ssDataClient.getLocalPort();
sFromServer = "227 Entering Passive Mode (" + sLocalIP + "," + (int)(iPort/256) + "," + (iPort % 256) + ")";
pwClient.println(sFromServer);
System.out.println(sProxy + sFromServer);
ssDataServer = new ServerSocket(0);
iPort = ssDataServer.getLocalPort();
sFromClient = "PORT " + sLocalIP + ',' + (int)(iPort/256) + ',' + (iPort % 256);
pwServer.println(sFromClient);
System.out.println(sProxy + sFromClient);
bIgnoreServer = true;
(dcData = new DataConnect(ssDataClient, ssDataServer)).start();
} else if (sFromClient.toUpperCase().startsWith("PORT")) {
int iClientPort, i;
try {
i = sFromClient.lastIndexOf(',');
iClientPort = Integer.parseInt(sFromClient.substring(i+1));
iClientPort += 256 * Integer.parseInt(sFromClient.substring(sFromClient.lastIndexOf(',', i-1)+1, i));
} catch (Exception e) {throw new IOException();}
if (ssDataClient != null) try {ssDataClient.close();} catch (IOException ioe) {}
if (skDataClient != null) try {skDataClient.close();} catch (IOException ioe) {}
if (ssDataServer != null) try {ssDataServer.close();} catch (IOException ioe) {}
if (dcData != null) dcData.close();
ssDataClient = null;
try {
skDataClient = new Socket(skControlClient.getInetAddress(), iClientPort);
} catch (IOException ioe) {
sFromServer = "500 PORT command failed - try using PASV instead.";
pwClient.println(sFromServer);
System.out.println(sProxy + sFromServer);
System.out.println(ioe);
return;
}
ssDataServer = new ServerSocket(0);
int iPort = ssDataServer.getLocalPort();
sFromClient = "PORT " + sLocalIP + ',' + (int)(iPort/256) + ',' + (iPort % 256);
pwServer.println(sFromClient);
System.out.println(sProxy + sFromClient);
(dcData = new DataConnect(skDataClient, ssDataServer)).start();
} else {
pwServer.println(sFromClient);
System.out.println(sClient + sFromClient);
}
}
public void start() {
super.start();
String sFromServer;
while (!bClosed)
try {
if ((sFromServer = readLine(brServer)) == null) {
break;
}
fromServer(sFromServer);
} catch (IOException ioe) {
break;
}
close();
}
public void run() {
String sFromClient;
while (!bClosed)
try {
if ((sFromClient = readLine(brClient)) == null) {
break;
}
fromClient(sFromClient);
} catch (IOException ioe) {
break;
}
close();
}
public void close() {
if (!bClosed) {
bClosed = true;
if (ssDataClient != null) try {ssDataClient.close();} catch (IOException ioe) {}
if (ssDataServer != null) try {ssDataServer.close();} catch (IOException ioe) {}
if (pwClient != null) pwClient.close();
if (pwServer != null) pwServer.close();
if (dcData != null) dcData.close();
}
}
}
public class DataConnect extends Thread {
private byte bRead[] = new byte[iDATABUFFERSIZE];
private ServerSocket ss1, ss2;
private Socket sk1, sk2;
boolean bClosed, bUsed, bFirst = true;
public DataConnect (ServerSocket ss1, ServerSocket ss2) throws SocketException {
this.ss1 = ss1;
this.ss2 = ss2;
}
public DataConnect (Socket sk1, ServerSocket ss2) throws SocketException {
this.sk1 = sk1;
this.ss2 = ss2;
}
public void run() {
BufferedInputStream bis=null;
BufferedOutputStream bos=null;
try {
if (bFirst) {
bFirst = false;
if (ss1 != null) {
sk1 = ss1.accept();
ss1.close();
}
sk2 = ss2.accept();
ss2.close();
sk1.setSoTimeout(iDATASOTIMEOUT);
sk2.setSoTimeout(iDATASOTIMEOUT);
bis = new BufferedInputStream(sk1.getInputStream());
bos = new BufferedOutputStream(sk2.getOutputStream());
new Thread(this).start();
} else {
bis = new BufferedInputStream(sk2.getInputStream());
bos = new BufferedOutputStream(sk1.getOutputStream());
}
int i;
boolean bUsedLocal = false ;
while (!bClosed)
try {
while ((i = bis.read(bRead, 0, iDATABUFFERSIZE)) != -1) {
bos.write(bRead, 0, i);
bUsedLocal = true;
bUsed = true;
}
break;
} catch (InterruptedIOException iioe) {
if (bUsed && !bUsedLocal) return; //use data connection for EITHER send or receive
}
bos.flush();
} catch (IOException ioe) {
System.out.println(ioe);
}
try {bis.close();} catch (Exception e) {}
try {bos.close();} catch (Exception e) {}
close();
}
public void close() {
if (!bClosed) {
bClosed = true;
try {sk1.close();} catch (Exception e) {}
try {sk2.close();} catch (Exception e) {}
}
}
}
}
(Review ID: 47685)
======================================================================
Name: diC59631 Date: 12/10/98
The compiler output:
ERROR: sun.tools.java.CompilerError: stack under flow: 197: invokevirtual void start() = -1
-- listing --
$55:
128: aload 1
128: astore 3
130: aload 3
130: ifnonnull $56:
131: aload 0
131: invokevirtual void close()
132: return
$56:
133: aload 3
133: invokevirtual java.lang.String toUpperCase()
133: ldc "PASS"
133: invokevirtual boolean startsWith(java.lang.String)
133: ifeq $58:
134: aload 0
134: getfield FtpProxy this$0
134: invokestatic java.io.PrintWriter access$4(FtpProxy)
134: aload 3
134: invokevirtual void println(java.lang.String)
135: getstatic java.io.PrintStream out
135: new class java.lang.StringBuffer
135: dup
135: invokestatic java.lang.String access$5()
135: invokestatic java.lang.String valueOf(java.lang.Object)
135: invokespecial java.lang.StringBuffer(java.lang.String)
135: ldc "PASS *****"
135: invokevirtual java.lang.StringBuffer append(java.lang.String)
135: invokevirtual java.lang.String toString()
135: invokevirtual void println(java.lang.String)
133: return
$58:
136: aload 3
136: invokevirtual java.lang.String toUpperCase()
136: ldc "PASV"
136: invokevirtual boolean startsWith(java.lang.String)
136: ifeq $60:
137: getstatic java.io.PrintStream out
137: new class java.lang.StringBuffer
137: dup
137: invokestatic java.lang.String access$5()
137: invokestatic java.lang.String valueOf(java.lang.Object)
137: invokespecial java.lang.StringBuffer(java.lang.String)
137: aload 3
137: invokevirtual java.lang.StringBuffer append(java.lang.String)
137: invokevirtual java.lang.String toString()
137: invokevirtual void println(java.lang.String)
139: try 1769751
139: aload 0
139: getfield FtpProxy this$0
139: invokestatic java.net.ServerSocket access$6(FtpProxy)
139: ifnull $61:
139: aload 0
139: getfield FtpProxy this$0
139: invokestatic java.net.ServerSocket access$6(FtpProxy)
139: invokevirtual void close()
$62:
139: goto $61:
$63:
139: pop
$61:
140: try 1769718
140: aload 0
140: getfield FtpProxy this$0
140: invokestatic java.net.Socket access$7(FtpProxy)
140: ifnull $65:
140: aload 0
140: getfield FtpProxy this$0
140: invokestatic java.net.Socket access$7(FtpProxy)
140: invokevirtual void close()
$66:
140: goto $65:
$67:
140: pop
$65:
141: try 1769770
141: aload 0
141: getfield FtpProxy this$0
141: invokestatic java.net.ServerSocket access$8(FtpProxy)
141: ifnull $69:
141: aload 0
141: getfield FtpProxy this$0
141: invokestatic java.net.ServerSocket access$8(FtpProxy)
141: invokevirtual void close()
$70:
141: goto $69:
$71:
141: pop
$69:
142: aload 0
142: getfield FtpProxy this$0
142: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
142: ifnull $73:
142: aload 0
142: getfield FtpProxy this$0
142: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
142: invokevirtual void close()
$73:
143: aload 0
143: getfield FtpProxy this$0
143: aconst_null
143: invokestatic void access$10(FtpProxy, java.net.Socket)
145: aload 0
145: getfield FtpProxy this$0
145: new class java.net.ServerSocket
145: dup
145: iconst_0 0
145: invokespecial java.net.ServerSocket(int)
145: invokestatic void access$11(FtpProxy, java.net.ServerSocket)
147: aload 0
147: getfield FtpProxy this$0
147: invokestatic java.net.ServerSocket access$6(FtpProxy)
147: invokevirtual int getLocalPort()
147: istore 4
148: new class java.lang.StringBuffer
148: dup
148: ldc "227 Entering Passive Mode ("
148: invokespecial java.lang.StringBuffer(java.lang.String)
148: aload 0
148: getfield FtpProxy this$0
148: invokestatic java.lang.String access$12(FtpProxy)
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: ldc ","
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: iload 4
148: sipush 256
148: idiv
148: invokevirtual java.lang.StringBuffer append(int)
148: ldc ","
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: iload 4
148: sipush 256
148: irem
148: invokevirtual java.lang.StringBuffer append(int)
148: ldc ")"
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: invokevirtual java.lang.String toString()
148: astore 2
149: aload 0
149: getfield FtpProxy this$0
149: invokestatic java.io.PrintWriter access$2(FtpProxy)
149: aload 2
149: invokevirtual void println(java.lang.String)
150: getstatic java.io.PrintStream out
150: new class java.lang.StringBuffer
150: dup
150: invokestatic java.lang.String access$13()
150: invokestatic java.lang.String valueOf(java.lang.Object)
150: invokespecial java.lang.StringBuffer(java.lang.String)
150: aload 2
150: invokevirtual java.lang.StringBuffer append(java.lang.String)
150: invokevirtual java.lang.String toString()
150: invokevirtual void println(java.lang.String)
152: aload 0
152: getfield FtpProxy this$0
152: new class java.net.ServerSocket
152: dup
152: iconst_0 0
152: invokespecial java.net.ServerSocket(int)
152: invokestatic void access$14(FtpProxy, java.net.ServerSocket)
154: aload 0
154: getfield FtpProxy this$0
154: invokestatic java.net.ServerSocket access$8(FtpProxy)
154: invokevirtual int getLocalPort()
154: istore 4
155: new class java.lang.StringBuffer
155: dup
155: ldc "PORT "
155: invokespecial java.lang.StringBuffer(java.lang.String)
155: aload 0
155: getfield FtpProxy this$0
155: invokestatic java.lang.String access$12(FtpProxy)
155: invokevirtual java.lang.StringBuffer append(java.lang.String)
155: bipush 44
155: invokevirtual java.lang.StringBuffer append(char)
155: iload 4
155: sipush 256
155: idiv
155: invokevirtual java.lang.StringBuffer append(int)
155: bipush 44
155: invokevirtual java.lang.StringBuffer append(char)
155: iload 4
155: sipush 256
155: irem
155: invokevirtual java.lang.StringBuffer append(int)
155: invokevirtual java.lang.String toString()
155: astore 3
157: aload 0
157: getfield FtpProxy this$0
157: invokestatic java.io.PrintWriter access$4(FtpProxy)
157: aload 3
157: invokevirtual void println(java.lang.String)
158: getstatic java.io.PrintStream out
158: new class java.lang.StringBuffer
158: dup
158: invokestatic java.lang.String access$13()
158: invokestatic java.lang.String valueOf(java.lang.Object)
158: invokespecial java.lang.StringBuffer(java.lang.String)
158: aload 3
158: invokevirtual java.lang.StringBuffer append(java.lang.String)
158: invokevirtual java.lang.String toString()
158: invokevirtual void println(java.lang.String)
160: aload 0
160: iconst_1 1
160: putfield boolean bIgnoreServer
162: aload 0
162: getfield FtpProxy this$0
162: new inner class FtpProxy. DataConnect
162: dup
162: aload 0
162: getfield FtpProxy this$0
162: aload 0
162: getfield FtpProxy this$0
162: invokestatic java.net.ServerSocket access$6(FtpProxy)
162: aload 0
162: getfield FtpProxy this$0
162: invokestatic java.net.ServerSocket access$8(FtpProxy)
162: invokespecial FtpProxy. DataConnect(FtpProxy,java.net.ServerSocket,java.net.ServerSocket)
162: invokestatic void access$15(FtpProxy, FtpProxy. DataConnect)
162: invokevirtual void start()
136: return
$60:
164: aload 3
164: invokevirtual java.lang.String toUpperCase()
164: ldc "PORT"
164: invokevirtual boolean startsWith(java.lang.String)
164: ifeq $75:
166: try 1770706
167: aload 3
167: bipush 44
167: invokevirtual int lastIndexOf(int)
167: istore 5
168: aload 3
168: iload 5
168: iconst_1 1
168: iadd
168: invokevirtual java.lang.String substring(int)
168: invokestatic int parseInt(java.lang.String)
168: istore 4
169: iload 4
169: sipush 256
169: aload 3
169: aload 3
169: bipush 44
169: iload 5
169: iconst_1 1
169: isub
169: invokevirtual int lastIndexOf(int, int)
169: iconst_1 1
169: iadd
169: iload 5
169: invokevirtual java.lang.String substring(int, int)
169: invokestatic int parseInt(java.lang.String)
169: imul
169: iadd
169: istore 4
$77:
166: goto $76:
$78:
170: pop
170: new class java.io.IOException
170: dup
170: invokespecial java.io.IOException()
170: athrow
$76:
172: aload 0
172: getfield FtpProxy this$0
172: invokestatic java.net.ServerSocket access$6(FtpProxy)
172: ifnull $79:
172: try 1770783
172: aload 0
172: getfield FtpProxy this$0
172: invokestatic java.net.ServerSocket access$6(FtpProxy)
172: invokevirtual void close()
$81:
172: goto $79:
$82:
172: pop
172: goto $79:
$79:
173: aload 0
173: getfield FtpProxy this$0
173: invokestatic java.net.Socket access$7(FtpProxy)
173: ifnull $83:
173: try 1770835
173: aload 0
173: getfield FtpProxy this$0
173: invokestatic java.net.Socket access$7(FtpProxy)
173: invokevirtual void close()
$85:
173: goto $83:
$86:
173: pop
173: goto $83:
$83:
174: aload 0
174: getfield FtpProxy this$0
174: invokestatic java.net.ServerSocket access$8(FtpProxy)
174: ifnull $87:
174: try 1770802
174: aload 0
174: getfield FtpProxy this$0
174: invokestatic java.net.ServerSocket access$8(FtpProxy)
174: invokevirtual void close()
$89:
174: goto $87:
$90:
174: pop
174: goto $87:
$87:
175: aload 0
175: getfield FtpProxy this$0
175: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
175: ifnull $91:
175: aload 0
175: getfield FtpProxy this$0
175: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
175: invokevirtual void close()
$91:
176: aload 0
176: getfield FtpProxy this$0
176: aconst_null
176: invokestatic void access$11(FtpProxy, java.net.ServerSocket)
178: try 1770844
179: aload 0
179: getfield FtpProxy this$0
179: new class java.net.Socket
179: dup
179: aload 0
179: getfield FtpProxy this$0
179: invokestatic java.net.Socket access$16(FtpProxy)
179: invokevirtual java.net.InetAddress getInetAddress()
179: iload 4
179: invokespecial java.net.Socket(java.net.InetAddress,int)
179: invokestatic void access$10(FtpProxy, java.net.Socket)
$93:
178: goto $92:
$94:
180: astore 6
181: ldc "500 PORT command failed - try using PASV instead."
181: astore 2
182: aload 0
182: getfield FtpProxy this$0
182: invokestatic java.io.PrintWriter access$2(FtpProxy)
182: aload 2
182: invokevirtual void println(java.lang.String)
183: getstatic java.io.PrintStream out
183: new class java.lang.StringBuffer
183: dup
183: invokestatic java.lang.String access$13()
183: invokestatic java.lang.String valueOf(java.lang.Object)
183: invokespecial java.lang.StringBuffer(java.lang.String)
183: aload 2
183: invokevirtual java.lang.StringBuffer append(java.lang.String)
183: invokevirtual java.lang.String toString()
183: invokevirtual void println(java.lang.String)
185: getstatic java.io.PrintStream out
185: aload 6
185: invokevirtual void println(java.lang.Object)
186: return
$92:
189: aload 0
189: getfield FtpProxy this$0
189: new class java.net.ServerSocket
189: dup
189: iconst_0 0
189: invokespecial java.net.ServerSocket(int)
189: invokestatic void access$14(FtpProxy, java.net.ServerSocket)
191: aload 0
191: getfield FtpProxy this$0
191: invokestatic java.net.ServerSocket access$8(FtpProxy)
191: invokevirtual int getLocalPort()
191: istore 6
192: new class java.lang.StringBuffer
192: dup
192: ldc "PORT "
192: invokespecial java.lang.StringBuffer(java.lang.String)
192: aload 0
192: getfield FtpProxy this$0
192: invokestatic java.lang.String access$12(FtpProxy)
192: invokevirtual java.lang.StringBuffer append(java.lang.String)
192: bipush 44
192: invokevirtual java.lang.StringBuffer append(char)
192: iload 6
192: sipush 256
192: idiv
192: invokevirtual java.lang.StringBuffer append(int)
192: bipush 44
192: invokevirtual java.lang.StringBuffer append(char)
192: iload 6
192: sipush 256
192: irem
192: invokevirtual java.lang.StringBuffer append(int)
192: invokevirtual java.lang.String toString()
192: astore 3
194: aload 0
194: getfield FtpProxy this$0
194: invokestatic java.io.PrintWriter access$4(FtpProxy)
194: aload 3
194: invokevirtual void println(java.lang.String)
195: getstatic java.io.PrintStream out
195: new class java.lang.StringBuffer
195: dup
195: invokestatic java.lang.String access$13()
195: invokestatic java.lang.String valueOf(java.lang.Object)
195: invokespecial java.lang.StringBuffer(java.lang.String)
195: aload 3
195: invokevirtual java.lang.StringBuffer append(java.lang.String)
195: invokevirtual java.lang.String toString()
195: invokevirtual void println(java.lang.String)
197: aload 0
197: getfield FtpProxy this$0
197: new inner class FtpProxy. DataConnect
197: dup
197: aload 0
197: getfield FtpProxy this$0
197: aload 0
197: getfield FtpProxy this$0
197: invokestatic java.net.Socket access$7(FtpProxy)
197: aload 0
197: getfield FtpProxy this$0
197: invokestatic java.net.ServerSocket access$8(FtpProxy)
197: invokespecial FtpProxy. DataConnect(FtpProxy,java.net.Socket,java.net.ServerSocket)
197: invokestatic void access$15(FtpProxy, FtpProxy. DataConnect)
197: invokevirtual void start()
164: return
$75:
200: aload 0
200: getfield FtpProxy this$0
200: invokestatic java.io.PrintWriter access$4(FtpProxy)
200: aload 3
200: invokevirtual void println(java.lang.String)
201: getstatic java.io.PrintStream out
201: new class java.lang.StringBuffer
201: dup
201: invokestatic java.lang.String access$5()
201: invokestatic java.lang.String valueOf(java.lang.Object)
201: invokespecial java.lang.StringBuffer(java.lang.String)
201: aload 3
201: invokevirtual java.lang.StringBuffer append(java.lang.String)
201: invokevirtual java.lang.String toString()
201: invokevirtual void println(java.lang.String)
127: return
javac FtpProxy.java >xx
sun.tools.java.CompilerError: stack under flow: 197: invokevirtual void star
() = -1
at java.lang.Throwable.<init>(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.write(Compiled Code)
at sun.tools.javac.SourceClass.compileClass(Compiled Code)
at sun.tools.javac.SourceClass.compile(Compiled Code)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:473)
error: An error has occurred in the compiler; please file a bug report (http://
ava.sun.com/cgi-bin/bugreport.cgi).
1 error
The source:
// Java FTP Proxy Server
// by Christian Schmidt, 1998
// http://www.student.dtu.dk/~c960657/
import java.net.*;
import java.lang.*;
import java.io.*;
public class FtpProxy extends Thread {
private Socket skControlClient, skControlServer;
private BufferedReader brClient, brServer;
private PrintWriter pwClient, pwServer;
private ServerSocket ssDataClient, ssDataServer;
private Socket skDataClient;
private ControlConnect ccControl;
private DataConnect dcData;
private static int iSOTIMEOUT = 2000;
private static int iDATASOTIMEOUT = 1000;
private static int iDATABUFFERSIZE = 256;
private String sLocalIP;
private static St
private static String sClient = "Client> ";
private static String sProxy = "Proxy > ";
private static String sSpace = " ";
public FtpProxy (Socket skControlClient) {
this.skControlClient = skControlClient;
}
public void run() {
String sFromClient, sFromServer;
ccControl = new ControlConnect();
try {
brClient = new BufferedReader(new InputStreamReader(skControlClient.getInputStream()));
pwClient = new PrintWriter(skControlClient.getOutputStream(), true);
byte b[] = skControlClient.getLocalAddress().getAddress();
sLocalIP = (0xff & b[3]) + "," + (0xff & b[2]) + ',' + (0xff & b[1]) + ',' + (0xff & b[0]);
sFromServer = "220 Java FTP Proxy Server (usage: USERID=user@site) ready.";
pwClient.println(sFromServer);
System.out.println(sProxy + sFromServer);
sFromClient = brClient.readLine(); //should be "user@site"
System.out.println(sClient + sFromClient);
int i = sFromClient.indexOf('@');
if (i <= 5 || i + 4 >= sFromClient.length() || sFromClient.indexOf('.', i) == -1) {
//simple validation af input
sFromServer = "531 Incorrect usage - closing connection.";
System.out.println(sProxy + sFromServer);
pwClient.println(sFromServer);
skControlClient.close();
return;
}
String sUser = sFromClient.substring(0,i);
String sServerHost = sFromClient.substring(i+1);
System.out.println("Connecting to " + sServerHost + " on port 21");
Socket skControlServer = new Socket(sServerHost, 21);
brServer = new BufferedReader(new InputStreamReader(skControlServer.getInputStream()));
pwServer = new PrintWriter(skControlServer.getOutputStream(), true);
pwServer.println(sUser); //USER user
System.out.println(sProxy + sUser);
skControlClient.setSoTimeout(iSOTIMEOUT);
skControlServer.setSoTimeout(iSOTIMEOUT);
ccControl.start();
} catch (Exception e) {
try {
sFromServer = "421 Internal error, closing connection.";
System.out.println(sProxy + sFromServer + e.toString());
pwClient.println(sFromServer);
} catch (Exception ioe) {}
ccControl.close();
}
}
public static void main (String args[]) {
int port = 8089;
try {
if (args.length == 1)
port = Integer.parseInt(args[0]);
else if (args.length > 1)
System.out.println("Usage: java FtpProxy [port]");
} catch (NumberFormatException e) {}
try {
ServerSocket ssControlClient = new ServerSocket(port);
System.out.println("Listening on port " + port);
while (true) {
Socket skControlClient = ssControlClient.accept();
System.out.println("New connection");
new FtpProxy(skControlClient).start();
}
} catch (IOException ioe) {
System.out.println(ioe.toString());
}
}
public class ControlConnect extends Thread {
private boolean bClosed = false;
private boolean bIgnoreServer = true;
private String readLine(BufferedReader br) throws IOException {
while (!bClosed)
try {
return br.readLine();
} catch (InterruptedIOException iioe) {}
throw new IOException();
}
private synchronized void fromServer(String sFS) throws IOException {
String sFromClient, sFromServer = sFS;
if (!bIgnoreServer) pwClient.println(sFromServer);
System.out.println(sServer + sFromServer);
if (sFromServer.charAt(3) != '-') bIgnoreServer = false;
}
private synchronized void fromClient(String sFC) throws IOException {
String sFromServer, sFromClient = sFC;
if (sFromClient == null) {
close();
return;
} else if (sFromClient.toUpperCase().startsWith("PASS")) {
pwServer.println(sFromClient);
System.out.println(sClient + "PASS *****");
} else if (sFromClient.toUpperCase().startsWith("PASV")) {
System.out.println(sClient + sFromClient);
try {if (ssDataClient != null) ssDataClient.close();} catch (IOException ioe) {}
try {if (skDataClient != null) skDataClient.close();} catch (IOException ioe) {}
try {if (ssDataServer != null) ssDataServer.close();} catch (IOException ioe) {}
if (dcData != null) dcData.close();
skDataClient = null;
ssDataClient = new ServerSocket(0);
int iPort = ssDataClient.getLocalPort();
sFromServer = "227 Entering Passive Mode (" + sLocalIP + "," + (int)(iPort/256) + "," + (iPort % 256) + ")";
pwClient.println(sFromServer);
System.out.println(sProxy + sFromServer);
ssDataServer = new ServerSocket(0);
iPort = ssDataServer.getLocalPort();
sFromClient = "PORT " + sLocalIP + ',' + (int)(iPort/256) + ',' + (iPort % 256);
pwServer.println(sFromClient);
System.out.println(sProxy + sFromClient);
bIgnoreServer = true;
(dcData = new DataConnect(ssDataClient, ssDataServer)).start();
} else if (sFromClient.toUpperCase().startsWith("PORT")) {
int iClientPort, i;
try {
i = sFromClient.lastIndexOf(',');
iClientPort = Integer.parseInt(sFromClient.substring(i+1));
iClientPort += 256 * Integer.parseInt(sFromClient.substring(sFromClient.lastIndexOf(',', i-1)+1, i));
} catch (Exception e) {throw new IOException();}
if (ssDataClient != null) try {ssDataClient.close();} catch (IOException ioe) {}
if (skDataClient != null) try {skDataClient.close();} catch (IOException ioe) {}
if (ssDataServer != null) try {ssDataServer.close();} catch (IOException ioe) {}
if (dcData != null) dcData.close();
ssDataClient = null;
try {
skDataClient = new Socket(skControlClient.getInetAddress(), iClientPort);
} catch (IOException ioe) {
sFromServer = "500 PORT command failed - try using PASV instead.";
pwClient.println(sFromServer);
System.out.println(sProxy + sFromServer);
System.out.println(ioe);
return;
}
ssDataServer = new ServerSocket(0);
int iPort = ssDataServer.getLocalPort();
sFromClient = "PORT " + sLocalIP + ',' + (int)(iPort/256) + ',' + (iPort % 256);
pwServer.println(sFromClient);
System.out.println(sProxy + sFromClient);
(dcData = new DataConnect(skDataClient, ssDataServer)).start();
} else {
pwServer.println(sFromClient);
System.out.println(sClient + sFromClient);
}
}
public void start() {
super.start();
String sFromServer;
while (!bClosed)
try {
if ((sFromServer = readLine(brServer)) == null) {
break;
}
fromServer(sFromServer);
} catch (IOException ioe) {
break;
}
close();
}
public void run() {
String sFromClient;
while (!bClosed)
try {
if ((sFromClient = readLine(brClient)) == null) {
break;
}
fromClient(sFromClient);
} catch (IOException ioe) {
break;
}
close();
}
public void close() {
if (!bClosed) {
bClosed = true;
if (ssDataClient != null) try {ssDataClient.close();} catch (IOException ioe) {}
if (ssDataServer != null) try {ssDataServer.close();} catch (IOException ioe) {}
if (pwClient != null) pwClient.close();
if (pwServer != null) pwServer.close();
if (dcData != null) dcData.close();
}
}
}
public class DataConnect extends Thread {
private byte bRead[] = new byte[iDATABUFFERSIZE];
private ServerSocket ss1, ss2;
private Socket sk1, sk2;
boolean bClosed, bUsed, bFirst = true;
public DataConnect (ServerSocket ss1, ServerSocket ss2) throws SocketException {
this.ss1 = ss1;
this.ss2 = ss2;
}
public DataConnect (Socket sk1, ServerSocket ss2) throws SocketException {
this.sk1 = sk1;
this.ss2 = ss2;
}
public void run() {
BufferedInputStream bis=null;
BufferedOutputStream bos=null;
try {
if (bFirst) {
bFirst = false;
if (ss1 != null) {
sk1 = ss1.accept();
ss1.close();
}
sk2 = ss2.accept();
ss2.close();
sk1.setSoTimeout(iDATASOTIMEOUT);
sk2.setSoTimeout(iDATASOTIMEOUT);
bis = new BufferedInputStream(sk1.getInputStream());
bos = new BufferedOutputStream(sk2.getOutputStream());
new Thread(this).start();
} else {
bis = new BufferedInputStream(sk2.getInputStream());
bos = new BufferedOutputStream(sk1.getOutputStream());
}
int i;
boolean bUsedLocal = false ;
while (!bClosed)
try {
while ((i = bis.read(bRead, 0, iDATABUFFERSIZE)) != -1) {
bos.write(bRead, 0, i);
bUsedLocal = true;
bUsed = true;
}
break;
} catch (InterruptedIOException iioe) {
if (bUsed && !bUsedLocal) return; //use data connection for EITHER send or receive
}
bos.flush();
} catch (IOException ioe) {
System.out.println(ioe);
}
try {bis.close();} catch (Exception e) {}
try {bos.close();} catch (Exception e) {}
close();
}
public void close() {
if (!bClosed) {
bClosed = true;
try {sk1.close();} catch (Exception e) {}
try {sk2.close();} catch (Exception e) {}
}
}
}
}
(Review ID: 47685)
======================================================================
Name: diC59631 Date: 12/10/98
The compiler output:
ERROR: sun.tools.java.CompilerError: stack under flow: 197: invokevirtual void start() = -1
-- listing --
$55:
128: aload 1
128: astore 3
130: aload 3
130: ifnonnull $56:
131: aload 0
131: invokevirtual void close()
132: return
$56:
133: aload 3
133: invokevirtual java.lang.String toUpperCase()
133: ldc "PASS"
133: invokevirtual boolean startsWith(java.lang.String)
133: ifeq $58:
134: aload 0
134: getfield FtpProxy this$0
134: invokestatic java.io.PrintWriter access$4(FtpProxy)
134: aload 3
134: invokevirtual void println(java.lang.String)
135: getstatic java.io.PrintStream out
135: new class java.lang.StringBuffer
135: dup
135: invokestatic java.lang.String access$5()
135: invokestatic java.lang.String valueOf(java.lang.Object)
135: invokespecial java.lang.StringBuffer(java.lang.String)
135: ldc "PASS *****"
135: invokevirtual java.lang.StringBuffer append(java.lang.String)
135: invokevirtual java.lang.String toString()
135: invokevirtual void println(java.lang.String)
133: return
$58:
136: aload 3
136: invokevirtual java.lang.String toUpperCase()
136: ldc "PASV"
136: invokevirtual boolean startsWith(java.lang.String)
136: ifeq $60:
137: getstatic java.io.PrintStream out
137: new class java.lang.StringBuffer
137: dup
137: invokestatic java.lang.String access$5()
137: invokestatic java.lang.String valueOf(java.lang.Object)
137: invokespecial java.lang.StringBuffer(java.lang.String)
137: aload 3
137: invokevirtual java.lang.StringBuffer append(java.lang.String)
137: invokevirtual java.lang.String toString()
137: invokevirtual void println(java.lang.String)
139: try 1769751
139: aload 0
139: getfield FtpProxy this$0
139: invokestatic java.net.ServerSocket access$6(FtpProxy)
139: ifnull $61:
139: aload 0
139: getfield FtpProxy this$0
139: invokestatic java.net.ServerSocket access$6(FtpProxy)
139: invokevirtual void close()
$62:
139: goto $61:
$63:
139: pop
$61:
140: try 1769718
140: aload 0
140: getfield FtpProxy this$0
140: invokestatic java.net.Socket access$7(FtpProxy)
140: ifnull $65:
140: aload 0
140: getfield FtpProxy this$0
140: invokestatic java.net.Socket access$7(FtpProxy)
140: invokevirtual void close()
$66:
140: goto $65:
$67:
140: pop
$65:
141: try 1769770
141: aload 0
141: getfield FtpProxy this$0
141: invokestatic java.net.ServerSocket access$8(FtpProxy)
141: ifnull $69:
141: aload 0
141: getfield FtpProxy this$0
141: invokestatic java.net.ServerSocket access$8(FtpProxy)
141: invokevirtual void close()
$70:
141: goto $69:
$71:
141: pop
$69:
142: aload 0
142: getfield FtpProxy this$0
142: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
142: ifnull $73:
142: aload 0
142: getfield FtpProxy this$0
142: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
142: invokevirtual void close()
$73:
143: aload 0
143: getfield FtpProxy this$0
143: aconst_null
143: invokestatic void access$10(FtpProxy, java.net.Socket)
145: aload 0
145: getfield FtpProxy this$0
145: new class java.net.ServerSocket
145: dup
145: iconst_0 0
145: invokespecial java.net.ServerSocket(int)
145: invokestatic void access$11(FtpProxy, java.net.ServerSocket)
147: aload 0
147: getfield FtpProxy this$0
147: invokestatic java.net.ServerSocket access$6(FtpProxy)
147: invokevirtual int getLocalPort()
147: istore 4
148: new class java.lang.StringBuffer
148: dup
148: ldc "227 Entering Passive Mode ("
148: invokespecial java.lang.StringBuffer(java.lang.String)
148: aload 0
148: getfield FtpProxy this$0
148: invokestatic java.lang.String access$12(FtpProxy)
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: ldc ","
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: iload 4
148: sipush 256
148: idiv
148: invokevirtual java.lang.StringBuffer append(int)
148: ldc ","
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: iload 4
148: sipush 256
148: irem
148: invokevirtual java.lang.StringBuffer append(int)
148: ldc ")"
148: invokevirtual java.lang.StringBuffer append(java.lang.String)
148: invokevirtual java.lang.String toString()
148: astore 2
149: aload 0
149: getfield FtpProxy this$0
149: invokestatic java.io.PrintWriter access$2(FtpProxy)
149: aload 2
149: invokevirtual void println(java.lang.String)
150: getstatic java.io.PrintStream out
150: new class java.lang.StringBuffer
150: dup
150: invokestatic java.lang.String access$13()
150: invokestatic java.lang.String valueOf(java.lang.Object)
150: invokespecial java.lang.StringBuffer(java.lang.String)
150: aload 2
150: invokevirtual java.lang.StringBuffer append(java.lang.String)
150: invokevirtual java.lang.String toString()
150: invokevirtual void println(java.lang.String)
152: aload 0
152: getfield FtpProxy this$0
152: new class java.net.ServerSocket
152: dup
152: iconst_0 0
152: invokespecial java.net.ServerSocket(int)
152: invokestatic void access$14(FtpProxy, java.net.ServerSocket)
154: aload 0
154: getfield FtpProxy this$0
154: invokestatic java.net.ServerSocket access$8(FtpProxy)
154: invokevirtual int getLocalPort()
154: istore 4
155: new class java.lang.StringBuffer
155: dup
155: ldc "PORT "
155: invokespecial java.lang.StringBuffer(java.lang.String)
155: aload 0
155: getfield FtpProxy this$0
155: invokestatic java.lang.String access$12(FtpProxy)
155: invokevirtual java.lang.StringBuffer append(java.lang.String)
155: bipush 44
155: invokevirtual java.lang.StringBuffer append(char)
155: iload 4
155: sipush 256
155: idiv
155: invokevirtual java.lang.StringBuffer append(int)
155: bipush 44
155: invokevirtual java.lang.StringBuffer append(char)
155: iload 4
155: sipush 256
155: irem
155: invokevirtual java.lang.StringBuffer append(int)
155: invokevirtual java.lang.String toString()
155: astore 3
157: aload 0
157: getfield FtpProxy this$0
157: invokestatic java.io.PrintWriter access$4(FtpProxy)
157: aload 3
157: invokevirtual void println(java.lang.String)
158: getstatic java.io.PrintStream out
158: new class java.lang.StringBuffer
158: dup
158: invokestatic java.lang.String access$13()
158: invokestatic java.lang.String valueOf(java.lang.Object)
158: invokespecial java.lang.StringBuffer(java.lang.String)
158: aload 3
158: invokevirtual java.lang.StringBuffer append(java.lang.String)
158: invokevirtual java.lang.String toString()
158: invokevirtual void println(java.lang.String)
160: aload 0
160: iconst_1 1
160: putfield boolean bIgnoreServer
162: aload 0
162: getfield FtpProxy this$0
162: new inner class FtpProxy. DataConnect
162: dup
162: aload 0
162: getfield FtpProxy this$0
162: aload 0
162: getfield FtpProxy this$0
162: invokestatic java.net.ServerSocket access$6(FtpProxy)
162: aload 0
162: getfield FtpProxy this$0
162: invokestatic java.net.ServerSocket access$8(FtpProxy)
162: invokespecial FtpProxy. DataConnect(FtpProxy,java.net.ServerSocket,java.net.ServerSocket)
162: invokestatic void access$15(FtpProxy, FtpProxy. DataConnect)
162: invokevirtual void start()
136: return
$60:
164: aload 3
164: invokevirtual java.lang.String toUpperCase()
164: ldc "PORT"
164: invokevirtual boolean startsWith(java.lang.String)
164: ifeq $75:
166: try 1770706
167: aload 3
167: bipush 44
167: invokevirtual int lastIndexOf(int)
167: istore 5
168: aload 3
168: iload 5
168: iconst_1 1
168: iadd
168: invokevirtual java.lang.String substring(int)
168: invokestatic int parseInt(java.lang.String)
168: istore 4
169: iload 4
169: sipush 256
169: aload 3
169: aload 3
169: bipush 44
169: iload 5
169: iconst_1 1
169: isub
169: invokevirtual int lastIndexOf(int, int)
169: iconst_1 1
169: iadd
169: iload 5
169: invokevirtual java.lang.String substring(int, int)
169: invokestatic int parseInt(java.lang.String)
169: imul
169: iadd
169: istore 4
$77:
166: goto $76:
$78:
170: pop
170: new class java.io.IOException
170: dup
170: invokespecial java.io.IOException()
170: athrow
$76:
172: aload 0
172: getfield FtpProxy this$0
172: invokestatic java.net.ServerSocket access$6(FtpProxy)
172: ifnull $79:
172: try 1770783
172: aload 0
172: getfield FtpProxy this$0
172: invokestatic java.net.ServerSocket access$6(FtpProxy)
172: invokevirtual void close()
$81:
172: goto $79:
$82:
172: pop
172: goto $79:
$79:
173: aload 0
173: getfield FtpProxy this$0
173: invokestatic java.net.Socket access$7(FtpProxy)
173: ifnull $83:
173: try 1770835
173: aload 0
173: getfield FtpProxy this$0
173: invokestatic java.net.Socket access$7(FtpProxy)
173: invokevirtual void close()
$85:
173: goto $83:
$86:
173: pop
173: goto $83:
$83:
174: aload 0
174: getfield FtpProxy this$0
174: invokestatic java.net.ServerSocket access$8(FtpProxy)
174: ifnull $87:
174: try 1770802
174: aload 0
174: getfield FtpProxy this$0
174: invokestatic java.net.ServerSocket access$8(FtpProxy)
174: invokevirtual void close()
$89:
174: goto $87:
$90:
174: pop
174: goto $87:
$87:
175: aload 0
175: getfield FtpProxy this$0
175: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
175: ifnull $91:
175: aload 0
175: getfield FtpProxy this$0
175: invokestatic FtpProxy. DataConnect access$9(FtpProxy)
175: invokevirtual void close()
$91:
176: aload 0
176: getfield FtpProxy this$0
176: aconst_null
176: invokestatic void access$11(FtpProxy, java.net.ServerSocket)
178: try 1770844
179: aload 0
179: getfield FtpProxy this$0
179: new class java.net.Socket
179: dup
179: aload 0
179: getfield FtpProxy this$0
179: invokestatic java.net.Socket access$16(FtpProxy)
179: invokevirtual java.net.InetAddress getInetAddress()
179: iload 4
179: invokespecial java.net.Socket(java.net.InetAddress,int)
179: invokestatic void access$10(FtpProxy, java.net.Socket)
$93:
178: goto $92:
$94:
180: astore 6
181: ldc "500 PORT command failed - try using PASV instead."
181: astore 2
182: aload 0
182: getfield FtpProxy this$0
182: invokestatic java.io.PrintWriter access$2(FtpProxy)
182: aload 2
182: invokevirtual void println(java.lang.String)
183: getstatic java.io.PrintStream out
183: new class java.lang.StringBuffer
183: dup
183: invokestatic java.lang.String access$13()
183: invokestatic java.lang.String valueOf(java.lang.Object)
183: invokespecial java.lang.StringBuffer(java.lang.String)
183: aload 2
183: invokevirtual java.lang.StringBuffer append(java.lang.String)
183: invokevirtual java.lang.String toString()
183: invokevirtual void println(java.lang.String)
185: getstatic java.io.PrintStream out
185: aload 6
185: invokevirtual void println(java.lang.Object)
186: return
$92:
189: aload 0
189: getfield FtpProxy this$0
189: new class java.net.ServerSocket
189: dup
189: iconst_0 0
189: invokespecial java.net.ServerSocket(int)
189: invokestatic void access$14(FtpProxy, java.net.ServerSocket)
191: aload 0
191: getfield FtpProxy this$0
191: invokestatic java.net.ServerSocket access$8(FtpProxy)
191: invokevirtual int getLocalPort()
191: istore 6
192: new class java.lang.StringBuffer
192: dup
192: ldc "PORT "
192: invokespecial java.lang.StringBuffer(java.lang.String)
192: aload 0
192: getfield FtpProxy this$0
192: invokestatic java.lang.String access$12(FtpProxy)
192: invokevirtual java.lang.StringBuffer append(java.lang.String)
192: bipush 44
192: invokevirtual java.lang.StringBuffer append(char)
192: iload 6
192: sipush 256
192: idiv
192: invokevirtual java.lang.StringBuffer append(int)
192: bipush 44
192: invokevirtual java.lang.StringBuffer append(char)
192: iload 6
192: sipush 256
192: irem
192: invokevirtual java.lang.StringBuffer append(int)
192: invokevirtual java.lang.String toString()
192: astore 3
194: aload 0
194: getfield FtpProxy this$0
194: invokestatic java.io.PrintWriter access$4(FtpProxy)
194: aload 3
194: invokevirtual void println(java.lang.String)
195: getstatic java.io.PrintStream out
195: new class java.lang.StringBuffer
195: dup
195: invokestatic java.lang.String access$13()
195: invokestatic java.lang.String valueOf(java.lang.Object)
195: invokespecial java.lang.StringBuffer(java.lang.String)
195: aload 3
195: invokevirtual java.lang.StringBuffer append(java.lang.String)
195: invokevirtual java.lang.String toString()
195: invokevirtual void println(java.lang.String)
197: aload 0
197: getfield FtpProxy this$0
197: new inner class FtpProxy. DataConnect
197: dup
197: aload 0
197: getfield FtpProxy this$0
197: aload 0
197: getfield FtpProxy this$0
197: invokestatic java.net.Socket access$7(FtpProxy)
197: aload 0
197: getfield FtpProxy this$0
197: invokestatic java.net.ServerSocket access$8(FtpProxy)
197: invokespecial FtpProxy. DataConnect(FtpProxy,java.net.Socket,java.net.ServerSocket)
197: invokestatic void access$15(FtpProxy, FtpProxy. DataConnect)
197: invokevirtual void start()
164: return
$75:
200: aload 0
200: getfield FtpProxy this$0
200: invokestatic java.io.PrintWriter access$4(FtpProxy)
200: aload 3
200: invokevirtual void println(java.lang.String)
201: getstatic java.io.PrintStream out
201: new class java.lang.StringBuffer
201: dup
201: invokestatic java.lang.String access$5()
201: invokestatic java.lang.String valueOf(java.lang.Object)
201: invokespecial java.lang.StringBuffer(java.lang.String)
201: aload 3
201: invokevirtual java.lang.StringBuffer append(java.lang.String)
201: invokevirtual java.lang.String toString()
201: invokevirtual void println(java.lang.String)
127: return
javac FtpProxy.java >xx
sun.tools.java.CompilerError: stack under flow: 197: invokevirtual void star
() = -1
at java.lang.Throwable.<init>(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.write(Compiled Code)
at sun.tools.javac.SourceClass.compileClass(Compiled Code)
at sun.tools.javac.SourceClass.compile(Compiled Code)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:473)
error: An error has occurred in the compiler; please file a bug report (http://
ava.sun.com/cgi-bin/bugreport.cgi).
1 error
The source:
// Java FTP Proxy Server
// by Christian Schmidt, 1998
// http://www.student.dtu.dk/~c960657/
import java.net.*;
import java.lang.*;
import java.io.*;
public class FtpProxy extends Thread {
private Socket skControlClient, skControlServer;
private BufferedReader brClient, brServer;
private PrintWriter pwClient, pwServer;
private ServerSocket ssDataClient, ssDataServer;
private Socket skDataClient;
private ControlConnect ccControl;
private DataConnect dcData;
private static int iSOTIMEOUT = 2000;
private static int iDATASOTIMEOUT = 1000;
private static int iDATABUFFERSIZE = 256;
private String sLocalIP;
private static St