Merge pull request #463 from strawd/concurrent-requests
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Channels.Http / HttpReplyChannel.cs
index aded4c6b8f748fd29ca1c3e23a9cd30d50961b01..03e7cad1f1c4f7eff0afaab6e7c41ebd1801f848 100644 (file)
@@ -92,8 +92,8 @@ namespace System.ServiceModel.Channels.Http
                        AbortConnections (timeout);
                        // FIXME: this wait is sort of hack (because it should not be required), but without it some tests are blocked.
                        // This hack even had better be moved to base.CancelAsync().
-                       if (CurrentAsyncResult != null)
-                               CurrentAsyncResult.AsyncWaitHandle.WaitOne (TimeSpan.FromMilliseconds (300));
+//                     if (CurrentAsyncResult != null)
+//                             CurrentAsyncResult.AsyncWaitHandle.WaitOne (TimeSpan.FromMilliseconds (300));
                        return base.CancelAsync (timeout);
                }
 
@@ -168,13 +168,14 @@ namespace System.ServiceModel.Channels.Http
 
                        Message msg = null;
 
-                       if (ctxi.Request.HttpMethod == "POST") {
+                       if (ctxi.Request.HttpMethod == "POST")
                                msg = CreatePostMessage (ctxi);
-                               if (msg == null)
-                                       return false;
-                       } else if (ctxi.Request.HttpMethod == "GET")
+                       else if (ctxi.Request.HttpMethod == "GET")
                                msg = Message.CreateMessage (MessageVersion.None, null); // HTTP GET-based request
 
+                       if (msg == null)
+                               return false;
+
                        if (msg.Headers.To == null)
                                msg.Headers.To = ctxi.Request.Url;
                        msg.Properties.Add ("Via", LocalAddress.Uri);
@@ -239,6 +240,7 @@ namespace System.ServiceModel.Channels.Http
                                        msg.Headers.Action = action;
                                }
                        }
+                       msg.Properties.Add (RemoteEndpointMessageProperty.Name, new RemoteEndpointMessageProperty (ctxi.Request.ClientIPAddress, ctxi.Request.ClientPort));
 
                        return msg;
                }