3.0.5 patches
diff --git a/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html b/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
index eafb836..8ab45d1 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
+++ b/features/org.eclipse.wst.server_core.feature.patch/buildnotes_org.eclipse.wst.server_core.feature.patch.html
@@ -4,18 +4,19 @@
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Build" content="Build">
-   <title>WTP 3.0.4 Patches</title>
+   <title>WTP 3.0.5 Patches</title>
 </head>
 
 <body>
 
-<h1>WTP 3.0.4 Patches</h1>
+<h1>WTP 3.0.5 Patches</h1>
 
-<h2>Feature Patched: org.eclipse.wst.server_core.feature.patch</h2>
+<h2>Feature Patched: org.eclipse.wst.server_core.feature</h2>
 <h3>Plugin(s) replaced:</h3>
+<ul><li>org.eclipse.wst.server.core</li></ul>
+<p>Bug <a href='https://bugs.eclipse.org/279110'>279110</a>. Server status stuck on 'Republish'</p>
 <ul><li>org.eclipse.wst.internet.monitor.core</li></ul>
-<p>Bug <a href='https://bugs.eclipse.org/267125'>267125</a>. TCP/IP monitor causes connections to hang</p>
-<p>Bug <a href='https://bugs.eclipse.org/267472'>267472</a>. TCP/IP monitor does not display request messages properly</p>
+<p>Bug <a href='https://bugs.eclipse.org/279101'>279101</a>. TCP/IP HTTP parser is case sensitive, when the specs say it shouldn't be</p>
 
 
 </body></html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.server_core.feature.patch/feature.properties b/features/org.eclipse.wst.server_core.feature.patch/feature.properties
index 0ffc7d0..1c22244 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.server_core.feature.patch/feature.properties
@@ -25,10 +25,10 @@
 
 # "description" property - description of the feature
 description=\
-Contains fixes described in the following bugillia(s):\n\
+Contains fixes described in the following bugzilla(s):\n\
 \n\
-Bug https://bugs.eclipse.org/267125 TCP/IP monitor causes connections to hang\n\
-Bug https://bugs.eclipse.org/267472 TCP/IP monitor does not display request messages properly\n\
+Bug https://bugs.eclipse.org/279101 TCP/IP HTTP parser is case sensitive, when the specs say it shouldn't be\n\
+Bug https://bugs.eclipse.org/279110 Server status stuck on 'Republish'\n\
 \n\
 
 # "copyright" property - text of the "Feature Update Copyright"
diff --git a/features/org.eclipse.wst.server_core.feature.patch/feature.xml b/features/org.eclipse.wst.server_core.feature.patch/feature.xml
index 4ffe2dd..f41fefc 100644
--- a/features/org.eclipse.wst.server_core.feature.patch/feature.xml
+++ b/features/org.eclipse.wst.server_core.feature.patch/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.wst.server_core.feature.patch"
     label="%featureName"
-    version="3.0.4.qualifier"
+    version="3.0.5.qualifier"
     provider-name="%providerName">
 
     <description>%description</description>
@@ -12,10 +12,17 @@
     <license url="%licenseURL">%license</license>
 
    <requires>
-      <import feature="org.eclipse.wst.server_core.feature" version="3.0.4.v20090115-20Am8s733J3_4F1256" patch="true"/>
+      <import feature="org.eclipse.wst.server_core.feature" version="3.0.5.v20090430-20Ao8s733K3_6A1226" patch="true"/>
    </requires>
 
    <plugin
+         id="org.eclipse.wst.server.core"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
          id="org.eclipse.wst.internet.monitor.core"
          download-size="0"
          install-size="0"
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
index ebf3926..c2a860f 100644
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
+++ b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/Trace.java
@@ -72,7 +72,7 @@
 		if (!MonitorPlugin.getInstance().isDebugging())
 			return;
 		
-		System.out.println(MonitorPlugin.PLUGIN_ID + " " + System.currentTimeMillis() + " " + s);
+		System.out.println(MonitorPlugin.PLUGIN_ID + " " + System.currentTimeMillis() + " thread=["+Thread.currentThread().getId() +"]" + s);
 		if (t != null)
 			t.printStackTrace();
 	}
diff --git a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
index 2acbbe1..8eee71f 100644
--- a/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
+++ b/plugins/org.eclipse.wst.internet.monitor.core/monitorcore/org/eclipse/wst/internet/monitor/core/internal/http/HTTPThread.java
@@ -220,7 +220,7 @@
 						b2Index += n;
 					}
 					out.write(readBuffer, 0, n);					
-					Trace.trace(Trace.PARSING,  "[Request] bytes read: "+ n + " bytesLeft: "+ bytesLeft);
+					Trace.trace(Trace.PARSING, "[Request] bytes read: "+ n + " bytesLeft: "+ bytesLeft);
 				}
 				
 				// restore the byte array for display
@@ -356,6 +356,7 @@
 			byte[] b = readLine();
 	
 			String s = new String(b);
+			Trace.trace(Trace.PARSING, "Chunk-length: "+s);
 			int index = s.indexOf(" ");
 			int length = -1;
 			try {
@@ -620,7 +621,7 @@
 			if (port != 80)
 				t += ":" + port;
 			return convert(t.getBytes());
-		} else if (s.startsWith("Content-Length: ")) {
+		} else if (s.toLowerCase().startsWith("content-length: ")) {
 			try {
 				contentLength = Integer.parseInt(s.substring(16).trim());
 				Trace.trace(Trace.PARSING, "Content length: " + this + " " + contentLength);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
index 0c0396d..519c51b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -52,6 +52,12 @@
 	public static final int AUTO_PUBLISH_DISABLE = 1;
 	public static final int AUTO_PUBLISH_ENABLE = 2;
 
+	private static String PUBLISH_AUTO_STRING = "auto";
+	private static String PUBLISH_CLEAN_STRING = "clean";
+	private static String PUBLISH_FULL_STRING = "full";
+	private static String PUBLISH_INCREMENTAL_STRING = "incremental";
+	private static String PUBLISH_UNKOWN = "unkown";
+	
 	protected static final String PROP_HOSTNAME = "hostname";
 	protected static final String SERVER_ID = "server-id";
 	protected static final String RUNTIME_ID = "runtime-id";
@@ -759,6 +765,10 @@
 	protected void handleModuleProjectChange(IModule module) {
 		Trace.trace(Trace.FINEST, "> handleDeployableProjectChange() " + this + " " + module);
 		
+		if (!isModuleDeployed(module)){
+			return;
+		}
+		
 		// check for duplicate jobs already waiting and don't create a new one
 		Job[] jobs = Job.getJobManager().find(ServerUtil.SERVER_JOB_FAMILY);
 		if (jobs != null) {
@@ -779,6 +789,30 @@
 		
 		Trace.trace(Trace.FINEST, "< handleDeployableProjectChange()");
 	}
+	
+	protected boolean isModuleDeployed(final IModule requestedModule){
+		Trace.trace(Trace.FINEST, "> isModuleDeployed()");
+
+		// no modules are deployed
+		if (modules.isEmpty())
+			return false;
+		
+		// shallow search: check for root modules first
+		boolean rv = modules.contains(requestedModule);
+		
+		// deep search: look into all the child modules
+		rv = !visitModule(modules.toArray(new IModule[0]), new IModuleVisitor(){
+				public boolean visit(IModule[] modules2) {
+					for (int i =0;i<=modules2.length-1;i++){
+						if (modules2[i].equals(requestedModule))
+							return false;
+					}
+					return !modules2.equals(requestedModule);
+			}}, null);
+		
+		Trace.trace(Trace.FINEST, "< isModuleDeployed() rv="+rv);
+		return rv;
+	}
 
 	protected void stopAutoPublish() {
 		if (autoPublishThread == null)
@@ -1093,6 +1127,7 @@
 	 * Publish the given modules to the server.
 	 */
 	public void publish(final int kind, final List<IModule[]> modules2, final IAdaptable info, final IOperationListener opListener) {
+		Trace.trace(Trace.FINEST, "-->-- publish() kind: <"+getPublishKindString(kind)+"> modules=" + modules2 + " -->--");
 		if (getServerType() == null) {
 			if (opListener != null)
 				opListener.done(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, Messages.errorMissingAdapter, null));
@@ -2479,6 +2514,7 @@
 
 	protected IStatus publishImpl(int kind, List<IModule[]> modules4, IAdaptable info, IProgressMonitor monitor) {
 		Trace.trace(Trace.FINEST, "-->-- Publishing to server: " + Server.this.toString() + " -->--");
+		Trace.trace(Trace.FINEST, "Server.publishImpl(): kind=<"+getPublishKindString(kind)+"> modules=" + modules4);
 		
 		stopAutoPublish();
 		
@@ -2511,7 +2547,7 @@
 			getServerPublishInfo().save();
 			
 			firePublishFinished(Status.OK_STATUS);
-			Trace.trace(Trace.PERFORMANCE, "Server.publish(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
+			Trace.trace(Trace.PERFORMANCE, "Server.publishImpl(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
 			return status;
 		} catch (Exception e) {
 			Trace.trace(Trace.SEVERE, "Error calling delegate publish() " + Server.this.toString(), e);
@@ -2980,4 +3016,20 @@
 	public String toString() {
 		return getName();
 	}
-}
\ No newline at end of file
+	
+	private String getPublishKindString(int kind){
+		if (kind == IServer.PUBLISH_AUTO){
+			return PUBLISH_AUTO_STRING;
+		}
+		else if (kind == IServer.PUBLISH_CLEAN){
+			return PUBLISH_CLEAN_STRING;
+		}
+		else if (kind == IServer.PUBLISH_FULL){
+			return PUBLISH_FULL_STRING;
+		}
+		else if (kind == IServer.PUBLISH_INCREMENTAL){
+			return PUBLISH_INCREMENTAL_STRING;
+		}
+		return PUBLISH_UNKOWN;
+	}
+}