Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: sdk/lib/io/http_impl.dart

Issue 12095014: IO v2: Update a number of HTTP tests to pass (Closed) Base URL: http://dart.googlecode.com/svn/experimental/lib_v2_io/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http.dart ('k') | tests/standalone/io/http_advanced_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
===================================================================
--- sdk/lib/io/http_impl.dart (revision 17714)
+++ sdk/lib/io/http_impl.dart (working copy)
@@ -161,6 +161,8 @@
// Create session, store it in connection, and return.
return _session = _httpServer._sessionManager.createSession();
}
+
+ HttpConnectionInfo get connectionInfo => _httpConnection.connectionInfo;
}
@@ -260,6 +262,8 @@
return _httpRequest._httpClientConnection.detachSocket();
}
+ HttpConnectionInfo get connectionInfo => _httpRequest.connectionInfo;
+
bool get _shouldAuthenticate {
// Only try to authenticate if there is a challenge in the response.
List<String> challenge = headers[HttpHeaders.WWW_AUTHENTICATE];
@@ -442,6 +446,8 @@
return future;
}
+ HttpConnectionInfo get connectionInfo => _httpRequest.connectionInfo;
+
void _fullBodyWritten() {
if (!_httpRequest._incoming.fullBodyRead) {
_httpRequest._httpConnection._socket.destroy();
@@ -607,6 +613,8 @@
_followRedirects = followRedirects;
}
+ HttpConnectionInfo get connectionInfo => _httpClientConnection.connectionInfo;
+
void _onIncoming(_HttpIncoming incoming) {
var response = new _HttpClientResponse(incoming,
this,
@@ -919,6 +927,8 @@
// TODO(ajohnsen): Remove socket from httpclient.
void destroy() => _socket.destroy();
+
+ HttpConnectionInfo get connectionInfo => _HttpConnectionInfo.create(_socket);
}
class _ConnnectionInfo {
@@ -1236,6 +1246,8 @@
});
}
+ HttpConnectionInfo get connectionInfo => _HttpConnectionInfo.create(_socket);
+
bool get _isActive => _state == _ACTIVE;
bool get _isIdle => _state == _IDLE;
bool get _isClosing => _state == _CLOSING;
@@ -1411,11 +1423,26 @@
class _HttpConnectionInfo implements HttpConnectionInfo {
+ static _HttpConnectionInfo create(Socket socket) {
+ if (socket == null) return null;
+ try {
+ _HttpConnectionInfo info = new _HttpConnectionInfo._();
+ info.remoteHost = socket.remoteHost;
+ info.remotePort = socket.remotePort;
+ info.localPort = socket.port;
+ return info;
+ } catch (e) { }
+ return null;
+ }
+
+ _HttpConnectionInfo._();
+
String remoteHost;
int remotePort;
int localPort;
}
+
class _DetachedSocket implements Socket {
final Stream<List<int>> _incoming;
final Socket _socket;
« no previous file with comments | « sdk/lib/io/http.dart ('k') | tests/standalone/io/http_advanced_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698