@@ -158,6 +158,10 @@ else if (operation.equals("send")) {
158158 query .getHeader ().setOpcode (Opcode .UPDATE );
159159 }
160160
161+ else if (operation .equals ("show" )) {
162+ print (query );
163+ }
164+
161165 else if (operation .equals ("query" ))
162166 doQuery (st );
163167
@@ -195,11 +199,18 @@ else if (operation.equals("assert")) {
195199 catch (InterruptedIOException iioe ) {
196200 System .out .println ("Operation timed out" );
197201 }
202+ catch (SocketException se ) {
203+ System .out .println ("Socket error" );
204+ }
198205 }
199206}
200207
201208void
202209sendUpdate () throws IOException {
210+ if (query .getHeader ().getCount (Section .UPDATE ) == 0 ) {
211+ print ("Empty update message. Ignoring." );
212+ return ;
213+ }
203214 if (query .getHeader ().getCount (Section .ZONE ) == 0 ) {
204215 Name updzone ;
205216 if (zone != null )
@@ -512,7 +523,7 @@ else if ((section = Section.value(field)) >= 0) {
512523 "add assert class delete echo file\n " +
513524 "glue help log key edns origin\n " +
514525 "port prohibit query quit require send\n " +
515- "server tcp ttl zone #\n " );
526+ "server show tcp ttl zone #\n " );
516527
517528 else if (topic .equalsIgnoreCase ("add" ))
518529 System .out .println (
@@ -605,6 +616,10 @@ else if (topic.equalsIgnoreCase("server"))
605616 System .out .println (
606617 "server <name>\n \n " +
607618 "server that receives send updates/queries\n " );
619+ else if (topic .equalsIgnoreCase ("show" ))
620+ System .out .println (
621+ "show\n \n " +
622+ "shows the current update packet\n " );
608623 else if (topic .equalsIgnoreCase ("tcp" ))
609624 System .out .println (
610625 "tcp\n \n " +
0 commit comments