gabriel / as3httpclient

HTTP Client for AS3
MIT License
243 stars 76 forks source link

"Error: No data available" raised in HttpBuffer.as, resolved #12

Open sclaggett opened 9 years ago

sclaggett commented 9 years ago

Thanks for the library, I've found it to be quite useful! It does have a bug that I encountered during development that I eventually hunted down and resolved.

Every once in a while, the error "No data available" will be thrown from HttpBuffer.readChunks() when readLine() returns null. This will occur when the chunk size (e.g. "3ef\r\n") is split between two TCP packets, something that is infrequent but still allowed. The fix is quite simple, just change the line: throw new Error("No data available"); To: return false; That's currently line 115 of src/org/httpclient/io/HttpBuffer.as.