Browse Source

add plaintext url to config file

Patrick Falls 12 years ago
parent
commit
4619dd6b40
2 changed files with 4 additions and 2 deletions
  1. 2 1
      netty/benchmark_config
  2. 2 1
      netty/src/main/java/hello/HelloServerHandler.java

+ 2 - 1
netty/benchmark_config

@@ -4,8 +4,9 @@
     "default": {
       "setup_file": "setup",
       "json_url": "/",
+      "plaintext_url": "/plaintext",
       "port": 8080,
       "sort": 30
     }
   }]
-}
+}

+ 2 - 1
netty/src/main/java/hello/HelloServerHandler.java

@@ -59,6 +59,7 @@ public class HelloServerHandler extends ChannelInboundMessageHandlerAdapter<Obje
             }
 
             if("/plaintext".equals(request.getUri())) {
+		buf.setLength(0);
                 buf.append("Hello, World!");
             } else {
                 Map<String, String> data = new HashMap<String, String>();
@@ -162,4 +163,4 @@ public class HelloServerHandler extends ChannelInboundMessageHandlerAdapter<Obje
         cause.printStackTrace();
         ctx.close();
     }
-}
+}