jcw/ethercard — pull request #56 by vicatcu (2012-10-21 00:40:02+00:00)
Title: Fragmented browseUrl response handling

Addresses jcw/ethercard/issues/54. This pull request is an attempt to minimize impacting the existing functionality. The only way this pull request impacts existing functionality is if you expressly call ether.persistTcpConnection(true) from your program. If you do that, it seems to allow me to receive multiple fragmented TCP packets from the same connection. The callback function gets called once for each fragment, so at least you can scan the results for something you're looking for in the body.

On a sidenote, and not to sound overly critical here, but the packetLoop function scores pretty low on maintainability IMHO. I had to instrument he heck out of it and read through a whole lot of TCP/IP protocol content on the web to make sense of it (and wasn't really able to totally reconcile the logic). If someone could help document what it's *supposed* to do in detail, I would be in favor of a rewrite at some point.