makerbot / ReplicatorG

An open-source gcode interpreter for driving RepRaps, Makerbots, and other similar CNC beasties
http://replicat.org
GNU General Public License v2.0
404 stars 226 forks source link

Fix support for unofficial firmware update servers that do not include type tags in their HTTP responses. #283

Closed Winter-Guerra closed 12 years ago

Winter-Guerra commented 12 years ago

Hey all, how's it going? Here's a solution to a ghost bug I've been dealing with all day now.

For some servers, the HTTP 200 OK return packets (containing the requested firmware file data) are not headed with a "Content-Type: text/plain" and therefore silently fail to be saved to disk. This silent failure can prove very frustrating for users who want to use un-official firmware update servers by entering their URL into RepG's preference pane and are unsure why ReplicatorG appears to successfully fetch and parse the firmware.xml, but doesn't actually end up saving the new files. This commit fixes the bug by dealing with the packet data in its (almost) raw form, thus rendering the type tag unnecessary.

For some reason, this error doesn't show up on any log file (ReplicatorG or otherwise) in any log level, but was diagnosed through a lengthy packet-by-packet investigation with Wireshark. Here's the annotated screen capture and side-by-side comparison of the two server responses: http://goo.gl/kuUt4

Happy Hacking! -Winter Guerra