/[storm]/storm/org/nongnu/storm/util/HTTPProxy.java
ViewVC logotype

Diff of /storm/org/nongnu/storm/util/HTTPProxy.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by benja, Sat Apr 19 12:20:32 2003 UTC revision 1.2 by benja, Mon Apr 21 21:07:41 2003 UTC
# Line 37  import java.net.*; Line 37  import java.net.*;
37  /** An HTTP server serving blocks from a Storm pool.  /** An HTTP server serving blocks from a Storm pool.
38   */   */
39  public class HTTPProxy implements Runnable {  public class HTTPProxy implements Runnable {
40      public static boolean dbg = true;      public static boolean dbg = false;
41      private static void p(String s) { System.out.println(s); }      private static void p(String s) { System.out.println(s); }
42    
43      protected StormPool pool;      protected StormPool pool;
# Line 58  public class HTTPProxy implements Runnab Line 58  public class HTTPProxy implements Runnab
58      }      }
59    
60      public void run() {      public void run() {
61          p("Starting server @ "+url+".");          if(dbg) p("Starting server @ "+url+".");
62          server.run();          server.run();
63      }      }
64    
# Line 85  public class HTTPProxy implements Runnab Line 85  public class HTTPProxy implements Runnab
85    
86                  BlockId id = new BlockId(uri);                  BlockId id = new BlockId(uri);
87                  Block block = pool.get(id);                  Block block = pool.get(id);
88                  p("<"+port+"> Serve: "+id);                  if(dbg) p("<"+port+"> Serve: "+id);
89                  HTTPResponse resp = resf.makeResponse(200, "Ok");                  HTTPResponse resp = resf.makeResponse(200, "Ok");
90                  resp.setField("Content-Type", id.getContentType());                  resp.setField("Content-Type", id.getContentType());
91                  if(!rewrite || !id.getContentType().equals("text/html")) {                  if(!rewrite || !id.getContentType().equals("text/html")) {
# Line 121  public class HTTPProxy implements Runnab Line 121  public class HTTPProxy implements Runnab
121      }      }
122    
123      public static void main(String[] args) throws Exception {      public static void main(String[] args) throws Exception {
124            dbg = true;
125          StormPool pool;          StormPool pool;
126          java.util.Set empty = java.util.Collections.EMPTY_SET;          java.util.Set empty = java.util.Collections.EMPTY_SET;
127          if(!args[0].equals("-gisp")) {          if(!args[0].equals("-gisp")) {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26