final class sun.rmi.transport.proxy.CGIForwardCommand implements sun.rmi.transport.proxy.CGICommandHandler
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: sun.rmi.transport.proxy.CGIForwardCommand
super_class: java.lang.Object
{
void <init>();
descriptor: ()V
flags: (0x0000)
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lsun/rmi/transport/proxy/CGIForwardCommand;
public java.lang.String getName();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: ldc "forward"
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lsun/rmi/transport/proxy/CGIForwardCommand;
public void execute(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=11, args_size=2
start local 0 start local 1 0: getstatic sun.rmi.transport.proxy.CGIHandler.RequestMethod:Ljava/lang/String;
ldc "POST"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 2
1: new sun.rmi.transport.proxy.CGIClientException
dup
ldc "can only forward POST requests"
invokespecial sun.rmi.transport.proxy.CGIClientException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 1
invokestatic java.lang.Integer.parseInt:(Ljava/lang/String;)I
istore 2
start local 2 3: goto 6
end local 2 StackMap locals:
StackMap stack: java.lang.NumberFormatException
4: pop
5: new sun.rmi.transport.proxy.CGIClientException
dup
ldc "invalid port number."
invokespecial sun.rmi.transport.proxy.CGIClientException.<init>:(Ljava/lang/String;)V
athrow
start local 2 6: StackMap locals: int
StackMap stack:
iload 2
ifle 7
iload 2
ldc 65535
if_icmple 8
7: StackMap locals:
StackMap stack:
new sun.rmi.transport.proxy.CGIClientException
dup
new java.lang.StringBuilder
dup
ldc "invalid port: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 2
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial sun.rmi.transport.proxy.CGIClientException.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals:
StackMap stack:
iload 2
sipush 1024
if_icmpge 12
9: new sun.rmi.transport.proxy.CGIClientException
dup
new java.lang.StringBuilder
dup
ldc "permission denied for port: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
10: iload 2
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
11: invokespecial sun.rmi.transport.proxy.CGIClientException.<init>:(Ljava/lang/String;)V
athrow
12: StackMap locals:
StackMap stack:
new java.net.Socket
dup
invokestatic java.net.InetAddress.getLocalHost:()Ljava/net/InetAddress;
iload 2
invokespecial java.net.Socket.<init>:(Ljava/net/InetAddress;I)V
astore 4
start local 4 13: goto 16
end local 4 StackMap locals:
StackMap stack: java.io.IOException
14: pop
15: new sun.rmi.transport.proxy.CGIServerException
dup
ldc "could not connect to local port"
invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
start local 4 16: StackMap locals: sun.rmi.transport.proxy.CGIForwardCommand java.lang.String int top java.net.Socket
StackMap stack:
new java.io.DataInputStream
dup
getstatic java.lang.System.in:Ljava/io/InputStream;
invokespecial java.io.DataInputStream.<init>:(Ljava/io/InputStream;)V
astore 5
start local 5 17: getstatic sun.rmi.transport.proxy.CGIHandler.ContentLength:I
newarray 8
astore 3
start local 3 18: aload 5
aload 3
invokevirtual java.io.DataInputStream.readFully:([B)V
19: goto 24
StackMap locals: sun.rmi.transport.proxy.CGIForwardCommand java.lang.String int byte[] java.net.Socket java.io.DataInputStream
StackMap stack: java.io.EOFException
20: pop
21: new sun.rmi.transport.proxy.CGIClientException
dup
ldc "unexpected EOF reading request body"
invokespecial sun.rmi.transport.proxy.CGIClientException.<init>:(Ljava/lang/String;)V
athrow
22: StackMap locals:
StackMap stack: java.io.IOException
pop
23: new sun.rmi.transport.proxy.CGIClientException
dup
ldc "error reading request body"
invokespecial sun.rmi.transport.proxy.CGIClientException.<init>:(Ljava/lang/String;)V
athrow
24: StackMap locals:
StackMap stack:
new java.io.DataOutputStream
dup
aload 4
invokevirtual java.net.Socket.getOutputStream:()Ljava/io/OutputStream;
invokespecial java.io.DataOutputStream.<init>:(Ljava/io/OutputStream;)V
25: astore 6
start local 6 26: aload 6
ldc "POST / HTTP/1.0\r\n"
invokevirtual java.io.DataOutputStream.writeBytes:(Ljava/lang/String;)V
27: aload 6
new java.lang.StringBuilder
dup
ldc "Content-length: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
28: getstatic sun.rmi.transport.proxy.CGIHandler.ContentLength:I
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
ldc "\r\n\r\n"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
29: invokevirtual java.io.DataOutputStream.writeBytes:(Ljava/lang/String;)V
30: aload 6
aload 3
invokevirtual java.io.DataOutputStream.write:([B)V
31: aload 6
invokevirtual java.io.DataOutputStream.flush:()V
end local 6 32: goto 35
StackMap locals:
StackMap stack: java.io.IOException
33: pop
34: new sun.rmi.transport.proxy.CGIServerException
dup
ldc "error writing to server"
invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
35: StackMap locals:
StackMap stack:
new java.io.DataInputStream
dup
aload 4
invokevirtual java.net.Socket.getInputStream:()Ljava/io/InputStream;
invokespecial java.io.DataInputStream.<init>:(Ljava/io/InputStream;)V
astore 6
start local 6 36: goto 39
end local 6 StackMap locals:
StackMap stack: java.io.IOException
37: pop
38: new sun.rmi.transport.proxy.CGIServerException
dup
ldc "error reading from server"
invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
start local 6 39: StackMap locals: java.io.DataInputStream
StackMap stack:
ldc "Content-length:"
invokevirtual java.lang.String.toLowerCase:()Ljava/lang/String;
astore 7
start local 7 40: iconst_0
istore 8
start local 8 41: iconst_m1
istore 10
start local 10 42: StackMap locals: sun.rmi.transport.proxy.CGIForwardCommand java.lang.String int byte[] java.net.Socket java.io.DataInputStream java.io.DataInputStream java.lang.String int top int
StackMap stack:
aload 6
invokevirtual java.io.DataInputStream.readLine:()Ljava/lang/String;
astore 9
start local 9 43: goto 46
end local 9 StackMap locals:
StackMap stack: java.io.IOException
44: pop
45: new sun.rmi.transport.proxy.CGIServerException
dup
ldc "error reading from server"
invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
start local 9 46: StackMap locals: sun.rmi.transport.proxy.CGIForwardCommand java.lang.String int byte[] java.net.Socket java.io.DataInputStream java.io.DataInputStream java.lang.String int java.lang.String int
StackMap stack:
aload 9
ifnonnull 50
47: new sun.rmi.transport.proxy.CGIServerException
dup
48: ldc "unexpected EOF reading server response"
49: invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
50: StackMap locals:
StackMap stack:
aload 9
invokevirtual java.lang.String.toLowerCase:()Ljava/lang/String;
aload 7
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifeq 58
51: iload 8
ifeq 55
52: new sun.rmi.transport.proxy.CGIServerException
dup
53: ldc "Multiple Content-length entries found."
54: invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
55: StackMap locals:
StackMap stack:
aload 9
aload 7
invokevirtual java.lang.String.length:()I
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
invokevirtual java.lang.String.trim:()Ljava/lang/String;
invokestatic java.lang.Integer.parseInt:(Ljava/lang/String;)I
56: istore 10
57: iconst_1
istore 8
58: StackMap locals:
StackMap stack:
aload 9
invokevirtual java.lang.String.length:()I
ifeq 60
59: aload 9
iconst_0
invokevirtual java.lang.String.charAt:(I)C
bipush 13
if_icmpeq 60
aload 9
iconst_0
invokevirtual java.lang.String.charAt:(I)C
bipush 10
if_icmpne 42
60: StackMap locals:
StackMap stack:
iload 8
ifeq 61
iload 10
ifge 64
61: StackMap locals:
StackMap stack:
new sun.rmi.transport.proxy.CGIServerException
dup
62: ldc "missing or invalid content length in server response"
63: invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
64: StackMap locals:
StackMap stack:
iload 10
newarray 8
astore 3
65: aload 6
aload 3
invokevirtual java.io.DataInputStream.readFully:([B)V
66: goto 73
StackMap locals:
StackMap stack: java.io.EOFException
67: pop
68: new sun.rmi.transport.proxy.CGIServerException
dup
69: ldc "unexpected EOF reading server response"
70: invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
71: StackMap locals:
StackMap stack: java.io.IOException
pop
72: new sun.rmi.transport.proxy.CGIServerException
dup
ldc "error reading from server"
invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
73: StackMap locals:
StackMap stack:
getstatic java.lang.System.out:Ljava/io/PrintStream;
ldc "Status: 200 OK"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
74: getstatic java.lang.System.out:Ljava/io/PrintStream;
ldc "Content-type: application/octet-stream"
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
75: getstatic java.lang.System.out:Ljava/io/PrintStream;
ldc ""
invokevirtual java.io.PrintStream.println:(Ljava/lang/String;)V
76: getstatic java.lang.System.out:Ljava/io/PrintStream;
aload 3
invokevirtual java.io.PrintStream.write:([B)V
77: goto 80
StackMap locals:
StackMap stack: java.io.IOException
78: pop
79: new sun.rmi.transport.proxy.CGIServerException
dup
ldc "error writing response"
invokespecial sun.rmi.transport.proxy.CGIServerException.<init>:(Ljava/lang/String;)V
athrow
80: StackMap locals:
StackMap stack:
getstatic java.lang.System.out:Ljava/io/PrintStream;
invokevirtual java.io.PrintStream.flush:()V
81: return
end local 10 end local 9 end local 8 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 82 0 this Lsun/rmi/transport/proxy/CGIForwardCommand;
0 82 1 param Ljava/lang/String;
3 4 2 port I
6 82 2 port I
18 82 3 buffer [B
13 14 4 socket Ljava/net/Socket;
16 82 4 socket Ljava/net/Socket;
17 82 5 clientIn Ljava/io/DataInputStream;
26 32 6 socketOut Ljava/io/DataOutputStream;
36 37 6 socketIn Ljava/io/DataInputStream;
39 82 6 socketIn Ljava/io/DataInputStream;
40 82 7 key Ljava/lang/String;
41 82 8 contentLengthFound Z
43 44 9 line Ljava/lang/String;
46 82 9 line Ljava/lang/String;
42 82 10 responseContentLength I
Exception table:
from to target type
2 3 4 Class java.lang.NumberFormatException
12 13 14 Class java.io.IOException
18 19 20 Class java.io.EOFException
18 19 22 Class java.io.IOException
24 32 33 Class java.io.IOException
35 36 37 Class java.io.IOException
42 43 44 Class java.io.IOException
65 66 67 Class java.io.EOFException
65 66 71 Class java.io.IOException
76 77 78 Class java.io.IOException
Exceptions:
throws sun.rmi.transport.proxy.CGIClientException, sun.rmi.transport.proxy.CGIServerException
MethodParameters:
Name Flags
param
}
SourceFile: "CGIHandler.java"