tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lar...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Http10Interceptor.java
Date Sat, 01 Sep 2001 13:03:07 GMT
larryi      01/09/01 06:03:06

  Modified:    src/share/org/apache/tomcat/modules/server
                        Http10Interceptor.java
  Log:
  Fix NPE where for certain invalid requests the context isn't set.
  
  Revision  Changes    Path
  1.22      +8 -4      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java
  
  Index: Http10Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Http10Interceptor.java	2001/08/31 09:45:50	1.21
  +++ Http10Interceptor.java	2001/09/01 13:03:06	1.22
  @@ -366,13 +366,17 @@
       }
   
       // return server name (or the reported one)
  -    if (reportedname == null)
  -        getMimeHeaders().setValue(  "Server" ).setString(request.getContext().getEngineHeader());
  -    else
  +    if (reportedname == null) {
  +        Context ctx = request.getContext();
  +        String server = ctx != null ? ctx.getEngineHeader() : 
  +                ContextManager.TOMCAT_NAME + "/" + ContextManager.TOMCAT_VERSION;    
  +        getMimeHeaders().setValue(  "Server" ).setString(server);
  +    } else {
           if (reportedname.length() != 0)
               getMimeHeaders().setValue(  "Server" ).setString(reportedname);
  +    }
   
  -	http.sendHeaders( getMimeHeaders() );
  +    http.sendHeaders( getMimeHeaders() );
       }
   
       public void doWrite( byte buffer[], int pos, int count)
  
  
  

Mime
View raw message