01: package vicazh.hyperpool.stream.net.http;
02:
03: import java.io.*;
04:
05: public class ContentHeadStream extends ServerStream {
06: ContentHeadStream(Session session, OutputStream outputstream) {
07: super (session, new ContentHeadNullStream(outputstream));
08: }
09:
10: private boolean c;
11:
12: public void field(String s1, String s2) throws IOException {
13: if (s1.equalsIgnoreCase("Connection")
14: && s2.equalsIgnoreCase("close"))
15: c = true;
16: super .field(s1, s2);
17: }
18:
19: public void end() {
20: super .end();
21: try {
22: if (c)
23: session.connection.getClient().close();
24: } catch (IOException e) {
25: }
26: }
27:
28: public void close() throws IOException {
29: super.close();
30: session.connection.getClient().close();
31: }
32: }
|