tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service TcpEndpoint.java
Date Wed, 05 Apr 2000 01:32:31 GMT
mandar      00/04/04 18:32:31

  Modified:    src/share/org/apache/jasper/compiler Tag: latest_TOMCAT_30
                        JspReader.java
               src/share/org/apache/tomcat/service Tag: latest_TOMCAT_30
                        TcpEndpoint.java
  Log:
  selected patches into the tag latest_TOMCAT_30
  (fix for the nested compile-time includes)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.2   +40 -18    jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- JspReader.java	2000/02/03 02:57:44	1.5.2.1
  +++ JspReader.java	2000/04/05 01:32:29	1.5.2.2
  @@ -87,6 +87,7 @@
       protected char stream[] = null;
       protected Mark current  = null;
       String master = null;
  +    String parent = null;
   
       Vector sourceFiles = new Vector();
       Stack includeStack;
  @@ -103,17 +104,23 @@
       class IncludeState {
   	Mark current;
   	char stream[] = null;
  +	String parent;
   
   	void restore() {
   	    JspReader.this.current = current;
   	    JspReader.this.stream = stream;
  +	    JspReader.this.parent = parent;
   	}
   	
   	IncludeState() {
   	    this.current = JspReader.this.current;
   	    this.stream = JspReader.this.stream;
  +	    this.parent = JspReader.this.parent;
   	}
   
  +	public String getParent() {
  +	    return this.parent;
  +	}
       }
   
       public String getFile(int fileid) {
  @@ -141,17 +148,32 @@
       public void pushFile(String name, String encoding) 
   	throws ParseException, FileNotFoundException
       {
  -        String parent = master == null ?
  -            null : master.substring(0, master.lastIndexOf("/") + 1);
  -        boolean isAbsolute = name.startsWith("/");
  +	boolean isAbsolute = name.startsWith("/");
  +	String filePath = null;
  +	String filePrefix = null;
  +
  +	// Use "parent" first.
  +	if (includeStack != null && includeStack.size() != 0) 
  +	    filePath =  ((IncludeState)includeStack.peek()).getParent();
  +
  +	// If "parent" is null then use "master"
  +	if (filePath == null) {
  +	    if (master == null) master = name;
  +	    filePath = master;
  +	}
  +	
  +	filePrefix = filePath.substring(0, filePath.lastIndexOf("/") + 1);
  +	
  +	// Set the parent so that the state can be captured correctly.
  +	if (isAbsolute)
  +	    this.parent = name;
  +	else
  +	    this.parent = filePrefix + name;
   
  -        if (parent == null || isAbsolute)
  +        if (filePath == null || isAbsolute)
               pushFile(new File(name), encoding);
           else
  -            pushFile(new File(parent + name), encoding);
  -
  -        if (master == null)
  -            master = name;
  +            pushFile(new File(filePrefix + name), encoding);
       }
   
       /**
  @@ -200,12 +222,11 @@
   	    this.stream = caw.toCharArray();
   	    this.current = new Mark(this, fileid);
   	    // Prepare a new include state:
  -	    if (includeStack == null) {
  -		// Initial file, prepare for include files:
  +	    if (includeStack == null)
   		includeStack = new Stack();
  -	    } else {
  -		includeStack.push(state);
  -	    }
  +
  +	    includeStack.push(state);
  +
           } catch (FileNotFoundException fnfe) {
               throw fnfe;
   	} catch (Throwable ex) {
  @@ -227,15 +248,16 @@
   	// missing.
   	if(includeStack == null) 
   		return false;
  -
  -	// Any thing left ?
  -	if ( includeStack.size() == 0 )
  -	    return false;
  +	
   	// Restore parser state:
   	size--;
   	IncludeState state = (IncludeState) includeStack.pop();
  -	//	System.out.println("Popping back... "+state.current);
   	state.restore();
  +	
  +	// Any thing left ?
  +	if ( includeStack.size() == 0 ) 
  +	    return false;
  +	
   	return true;
       }
   	
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.4   +5 -4      jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java
  
  Index: TcpEndpoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java,v
  retrieving revision 1.4.2.3
  retrieving revision 1.4.2.4
  diff -u -r1.4.2.3 -r1.4.2.4
  --- TcpEndpoint.java	2000/03/13 21:40:38	1.4.2.3
  +++ TcpEndpoint.java	2000/04/05 01:32:30	1.4.2.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java,v
1.4.2.3 2000/03/13 21:40:38 mandar Exp $
  - * $Revision: 1.4.2.3 $
  - * $Date: 2000/03/13 21:40:38 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java,v
1.4.2.4 2000/04/05 01:32:30 mandar Exp $
  + * $Revision: 1.4.2.4 $
  + * $Date: 2000/04/05 01:32:30 $
    *
    * ====================================================================
    *
  @@ -235,7 +235,7 @@
   	// XXX reuse, pools, etc
   
   	// XXX set socket options
  -	// 	s.setSoLinger( true, 100);
  +	s.setSoLinger( true, 100);
   	
   	TcpConnection con=new TcpConnection();
   	con.setEndpoint(this);
  @@ -252,6 +252,7 @@
   	    if (running == false) {
   		socket.close();  // rude, but unlikely!
   	    }
  +	    socket.setTcpNoDelay(true);
   	    processSocket(socket);
   	} catch (InterruptedIOException iioe) {
   	    // normal part -- should happen regularly so
  
  
  

Mime
View raw message