| 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 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 Function _handler; | 1441 Function _handler; |
| 1442 } | 1442 } |
| 1443 | 1443 |
| 1444 | 1444 |
| 1445 // HTTP server waiting for socket connections. The connections are | 1445 // HTTP server waiting for socket connections. The connections are |
| 1446 // managed by the server and as requests are received the request. | 1446 // managed by the server and as requests are received the request. |
| 1447 class _HttpServer implements HttpServer { | 1447 class _HttpServer implements HttpServer { |
| 1448 _HttpServer() : _connections = new Set<_HttpConnection>(), | 1448 _HttpServer() : _connections = new Set<_HttpConnection>(), |
| 1449 _handlers = new List<_RequestHandlerRegistration>(); | 1449 _handlers = new List<_RequestHandlerRegistration>(); |
| 1450 | 1450 |
| 1451 void listen(String host, int port, [int backlog = 128]) { | 1451 void listen(String host, int port, {int backlog: 128}) { |
| 1452 listenOn(new ServerSocket(host, port, backlog)); | 1452 listenOn(new ServerSocket(host, port, backlog)); |
| 1453 _closeServer = true; | 1453 _closeServer = true; |
| 1454 } | 1454 } |
| 1455 | 1455 |
| 1456 void listenOn(ServerSocket serverSocket) { | 1456 void listenOn(ServerSocket serverSocket) { |
| 1457 void onConnection(Socket socket) { | 1457 void onConnection(Socket socket) { |
| 1458 // Accept the client connection. | 1458 // Accept the client connection. |
| 1459 _HttpConnection connection = new _HttpConnection(this); | 1459 _HttpConnection connection = new _HttpConnection(this); |
| 1460 connection._connectionEstablished(socket); | 1460 connection._connectionEstablished(socket); |
| 1461 _connections.add(connection); | 1461 _connections.add(connection); |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2291 | 2291 |
| 2292 | 2292 |
| 2293 class _RedirectInfo implements RedirectInfo { | 2293 class _RedirectInfo implements RedirectInfo { |
| 2294 const _RedirectInfo(int this.statusCode, | 2294 const _RedirectInfo(int this.statusCode, |
| 2295 String this.method, | 2295 String this.method, |
| 2296 Uri this.location); | 2296 Uri this.location); |
| 2297 final int statusCode; | 2297 final int statusCode; |
| 2298 final String method; | 2298 final String method; |
| 2299 final Uri location; | 2299 final Uri location; |
| 2300 } | 2300 } |
| OLD | NEW |