Chromium Code Reviews| Index: runtime/bin/http.dart |
| diff --git a/runtime/bin/http.dart b/runtime/bin/http.dart |
| index b0ebda607ee356eec82d8935365890a4a9b7112f..e20fc7b33fa1c87f4782e5f04dc5285e34f90bf5 100644 |
| --- a/runtime/bin/http.dart |
| +++ b/runtime/bin/http.dart |
| @@ -388,10 +388,10 @@ interface HttpResponse default _HttpResponse { |
| * socket is detached the HTTP server will no longer perform any |
| * operations on it. |
| * |
| - * This is normally used when a HTTP upgraded request is received |
| + * This is normally used when a HTTP upgrade request is received |
| * and the communication should continue with a different protocol. |
| */ |
| - Socket detachSocket(); |
| + DetachedSocket detachSocket(); |
| } |
| @@ -485,6 +485,16 @@ interface HttpClientConnection { |
| * connecting or processing the HTTP request. |
| */ |
| void set onError(void callback(e)); |
| + |
| + /** |
| + * Detach the underlying socket from the HTTP client. When the |
| + * socket is detached the HTTP client will no longer perform any |
| + * operations on it. |
| + * |
| + * This is normally used when a HTTP upgrade is negotiated and the |
| + * communication should continue with a different protocol. |
| + */ |
| + DetachedSocket detachSocket(); |
| } |
| @@ -550,6 +560,20 @@ interface HttpClientResponse default _HttpClientResponse { |
| } |
| +/** |
| + * When detaching a socket from either the [:HttpServer:] or the |
| + * [:HttpClient:] due to a HTTP connection upgrade there might be |
| + * unparsed data already read from the socket. This unparsed data |
| + * together with the detached socket is returned in an instance of |
| + * this class. |
| + */ |
| +class DetachedSocket { |
|
Anders Johnsen
2012/05/02 07:51:57
The client should never create this object, so I t
Søren Gjesse
2012/05/02 10:22:45
Done.
|
| + DetachedSocket(this.socket, this.unparsedData); |
| + Socket socket; |
| + List<int> unparsedData; |
| +} |
| + |
| + |
| class HttpException implements Exception { |
| const HttpException([String this.message = ""]); |
| String toString() => "HttpException: $message"; |