-
Notifications
You must be signed in to change notification settings - Fork 170
responseBody() doesn't work when the lenght of the response is larger than 1500 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
responseBody() doesn't work when the lenght of the response is larger than 1500 #14
Comments
Hi @creends, Could you please provide a sketch to reproduce this issues? As well as let us know what board you are using. |
Thank's for your reply, @sandeepmistry I'm using an Arduino MKR1000. The sketch i'm using : demo.ino.txt |
@creends thanks. One more question, could you please provide more details of the server you are connecting to. Maybe a Wireshark capture of the response, or the code that is is running. PR #7 might also help with the issues you are seeing. |
I'm connecting to my Philips Hue bridge, I don't know more usefull information about the server. responseBody give me that : response.txt |
Thanks!
I don't think it chunk per say, they just didn't include a content length header in the response. Did you get a chance to try the changes in PR #7? |
Just tried #7, doesn't change anything. Maybe chunked was not the appropriate word. |
I'm able to reproduce it with the master version of this library and the following Node.js code to simulate the server: var net = require('net');
var response =
'HTTP/1.1 200 OK\r\n' +
'Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n' +
'Pragma: no-cache\r\n' +
'Expires: Mon, 1 Aug 2011 09:00:00 GMT\r\n' +
'Connection: close\r\n' +
'Access-Control-Max-Age: 3600\r\n' +
'Access-Control-Allow-Origin: *\r\n' +
'Access-Control-Allow-Credentials: true\r\n' +
'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE, HEAD\r\n' +
'Access-Control-Allow-Headers: Content-Type\r\n' +
'Content-type: application/json\r\n' +
'\r\n' +
'{"3":{"state":{"on":true,"bri":238,"hue":988,"sat":234,"effect":"none","xy":[0.6424,0.3332],"ct":153,"alert":"select","colormode":"xy","reachable":true},"type":"Extended color light","name":"Hue color lamp plafond","modelid":"LCT007","manufacturername":"Philips","uniqueid":"00:17:88:01:10:4b:b9:61-0b","swversion":"5.50.1.19085"},"4":{"state":{"on":true,"bri":238,"hue":988,"sat":234,"effect":"none","xy":[0.6424,0.3332],"ct":153,"alert":"none","colormode":"xy","reachable":true},"type":"Extended color light","name":"Hue color lamp mur","modelid":"LCT007","manufacturername":"Philips","uniqueid":"00:17:88:01:10:5d:96:ff-0b","swversion":"5.50.1.19085"},"5":{"state":{"on":true,"bri":238,"hue":3468,"sat":221,"effect":"none","xy":[0.6414,0.3353],"alert":"none","colormode":"xy","reachable":true},"type":"Color light","name":"Hue bloom","modelid":"LLC011","manufacturername":"Philips","uniqueid":"00:17:88:01:00:c1:c6:fa-0b","swversion":"5.23.1.13452"},"6":{"state":{"on":false,"bri":126,"hue":14957,"sat":141,"effect":"none","xy":[0.4576,0.4099],"ct":366,"alert":"none","colormode":"xy","reachable":true},"type":"Extended color light","name":"Hue color lamp entree","modelid":"LCT007","manufacturername":"Philips","uniqueid":"00:17:88:01:10:5d:91:82-0b","swversion":"5.50.1.19085"}}';
net.createServer(function (socket) {
var request = new Buffer(0);
socket.on('data', function (data) {
request = Buffer.concat([request, data]);
if (request.toString().indexOf('\r\n\r\n') !== -1) {
console.log(request.toString());
socket.write(response, function() {
socket.end();
});
}
});
}).listen(5000); |
So far, I think the issue actually lies in the WiFi101 library ... |
Definitely caused by the WiFi101 library, arduino-libraries/WiFi101#116 has a potential fix. @creends please try it out and provide your feedback. |
So arduino-libraries/WiFi101#116 works fine for me too. |
Great, there will be a new v0.11.1 release of the WiFi101 shortly that includes the fix. |
It produces various results like adding parts of the header at the end of the response, or not giving the entire response.
The text was updated successfully, but these errors were encountered: