| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class _HttpHeaders implements HttpHeaders { | 5 class _HttpHeaders implements HttpHeaders { |
| 6 _HttpHeaders() : _headers = new Map<String, List<String>>(); | 6 _HttpHeaders() : _headers = new Map<String, List<String>>(); |
| 7 | 7 |
| 8 List<String> operator[](String name) { | 8 List<String> operator[](String name) { |
| 9 name = name.toLowerCase(); | 9 name = name.toLowerCase(); |
| 10 return _headers[name]; | 10 return _headers[name]; |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 Function _handler; | 1425 Function _handler; |
| 1426 } | 1426 } |
| 1427 | 1427 |
| 1428 | 1428 |
| 1429 // HTTP server waiting for socket connections. The connections are | 1429 // HTTP server waiting for socket connections. The connections are |
| 1430 // managed by the server and as requests are received the request. | 1430 // managed by the server and as requests are received the request. |
| 1431 class _HttpServer implements HttpServer { | 1431 class _HttpServer implements HttpServer { |
| 1432 _HttpServer() : _connections = new Set<_HttpConnection>(), | 1432 _HttpServer() : _connections = new Set<_HttpConnection>(), |
| 1433 _handlers = new List<_RequestHandlerRegistration>(); | 1433 _handlers = new List<_RequestHandlerRegistration>(); |
| 1434 | 1434 |
| 1435 void listen(String host, int port, [int backlog = 5]) { | 1435 void listen(String host, int port, [int backlog = 128]) { |
| 1436 listenOn(new ServerSocket(host, port, backlog)); | 1436 listenOn(new ServerSocket(host, port, backlog)); |
| 1437 _closeServer = true; | 1437 _closeServer = true; |
| 1438 } | 1438 } |
| 1439 | 1439 |
| 1440 void listenOn(ServerSocket serverSocket) { | 1440 void listenOn(ServerSocket serverSocket) { |
| 1441 void onConnection(Socket socket) { | 1441 void onConnection(Socket socket) { |
| 1442 // Accept the client connection. | 1442 // Accept the client connection. |
| 1443 _HttpConnection connection = new _HttpConnection(this); | 1443 _HttpConnection connection = new _HttpConnection(this); |
| 1444 connection._connectionEstablished(socket); | 1444 connection._connectionEstablished(socket); |
| 1445 _connections.add(connection); | 1445 _connections.add(connection); |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 | 2166 |
| 2167 | 2167 |
| 2168 class _RedirectInfo implements RedirectInfo { | 2168 class _RedirectInfo implements RedirectInfo { |
| 2169 const _RedirectInfo(int this.statusCode, | 2169 const _RedirectInfo(int this.statusCode, |
| 2170 String this.method, | 2170 String this.method, |
| 2171 Uri this.location); | 2171 Uri this.location); |
| 2172 final int statusCode; | 2172 final int statusCode; |
| 2173 final String method; | 2173 final String method; |
| 2174 final Uri location; | 2174 final Uri location; |
| 2175 } | 2175 } |
| OLD | NEW |