Hi,
While trying the vertx test suite on windows I found a problem with the validation of the the sendFile test.
As far as I can see the server doing sendFile is behaving ok.
load('vertx.js')
var server = vertx.createHttpServer();
server.requestHandler(function(req) {
req.response.sendFile("lib/jars/netty.jar")
}).listen(8080, 'localhost');
Pointing a browser to localhost will download the file just fine.
But using a http client to download the file:
load('vertx.js')
var log = vertx.logger;
var client = vertx.createHttpClient().setPort(8080).setHost('localhost')
var url = "
http://localhost:8080/some-path";
client.getNow(url, function(resp) {
log.info('Got a response, status code: ' + resp.statusCode);
resp.dataHandler(function(buffer) {
log.info('I received ' + buffer.length() + ' bytes');
});
resp.endHandler(function() {
log.info('I recieved end');
});
});
will get me just one chunk of 8192 bytes
INFO: Got a response, status code: 200
INFO: I received 8192 bytes
and that is it. No further events arrive.
Since this is part of the test suite I'm almost certain that it is a windows only problem.
Tested with 1.0.1 and trunk.
On windows 7.
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
I tried to add log output to DefaultHttpClient.ClientHandler, and it seems that netty only send one HttpResponse and one HttpChunk and no more. No other callback is invoked.
This is not an urgent problem and it can easily wait, if anybody happens to be on vacation right now. It is IMO better to relax and enjoy yourself then answering questions on mail lists.
regards,
Finn