pier 00/11/30 11:56:02 Modified: catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java Log: Fixes and initial request handling. Revision Changes Path 1.2 +26 -10 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnectionHandler.java Index: WarpConnectionHandler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnectionHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WarpConnectionHandler.java 2000/11/30 16:34:30 1.1 +++ WarpConnectionHandler.java 2000/11/30 19:55:59 1.2 @@ -64,7 +64,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Pier Fumagalli</a> * @author Copyright © 1999, 2000 <a href="http://www.apache.org">The * Apache Software Foundation. - * @version CVS $Id: WarpConnectionHandler.java,v 1.1 2000/11/30 16:34:30 pier Exp $ + * @version CVS $Id: WarpConnectionHandler.java,v 1.2 2000/11/30 19:55:59 pier Exp $ */ public class WarpConnectionHandler extends WarpHandler { /** The WarpReader associated with this WarpConnectionHandler. */ @@ -94,22 +94,38 @@ try { switch (type) { case WarpConstants.TYP_HOST: - if (DEBUG) this.debug("HOST "+reader.readString()+":"+ - reader.readShort()+"="+123); - this.packet.writeShort(123); + // Retrieve this host id + int hid=123; + if (DEBUG) this.debug("HST "+reader.readString()+":"+ + reader.readShort()+"="+hid); + // Send the HOST ID back to the WARP client + this.packet.reset(); + this.packet.writeShort(hid); this.send(WarpConstants.TYP_HOST_ID,this.packet); break; case WarpConstants.TYP_APPLICATION: - if (DEBUG) - this.debug("APPL "+reader.readString()+":"+reader.readString()+"="+321); + // Retrieve this application id + int aid=321; + if (DEBUG) this.debug("APP "+reader.readString()+":"+ + reader.readString()+"="+aid); + // Send the APPLICATION ID back to the WARP client this.packet.reset(); - this.packet.writeShort(321); + this.packet.writeShort(aid); this.send(WarpConstants.TYP_APPLICATION_ID,this.packet); break; - default: - if (DEBUG) - this.debug("[Type="+type+"] ["+new String(buffer)+"]"); + case WarpConstants.TYP_REQUEST: + // Retrieve this request id + int rid=999; + if (DEBUG) this.debug("REQ "+reader.readShort()+":"+ + reader.readShort()+"="+rid); + // Send the RID back to the WARP client + this.packet.reset(); + this.packet.writeShort(rid); + this.send(WarpConstants.TYP_REQUEST_ID,this.packet); break; + default: + this.log("Wrong packet type "+type+". Closing connection"); + return(false); } return(true); } catch (IOException e) {