lasselukkari / aWOT

Arduino web server library.
MIT License
283 stars 41 forks source link

[Teensy 4.1] Requests only working if I clear the read buffer of a client before processing #139

Closed tt2468 closed 2 years ago

tt2468 commented 2 years ago

Using the default Ethernet example on Teensy 4.1 with the NativeEthernet library, aWOT will only correctly respond to requests if I do:

void loop(){
  EthernetClient client = server.available();
  if (client.connected()) {
    while (client.available()) {
      client.read();
    }
    app.process(&client);
    client.stop();
  }
}

If I don't read() all available bytes first, I get an error 400.

Thoughts?

lasselukkari commented 2 years ago

Hello!

If you take a look at he readme of this project it says Teensy 4.1 Ethernet library has a bug. I have not tested it for a while but last time I tried it myself it was pretty much unusable. It's sad because the performance should be really good. The readme also has a link to the open issue I created back then. The library maintainer was able to reproduce the issue but it's still open so I believe it has not been fixed.

I do not know if this the same problem I got back then but I think you should try to reproduce the problem without this library and report it to the maintainer of the Teensy 4.1 Ethernet library.

I think your workaround may cause other problems.

lasselukkari commented 2 years ago

I just took a look at open issues for the Teensy 4.1 ethernet library: https://github.com/vjmuzik/NativeEthernet/issues. There are so many major problems that I would still stay away from it. What a bummer!

tt2468 commented 2 years ago

Wow, that lib sure has a lot of issues. Funny enough though, with my fix, every feature of aWOT that I've used has worked flawlessly and reliably. I'll close this issue, since it's most definitely due to a NativeEthernet bug and not an aWOT bug.