firepear / petrel

It's like SQLite, but for networking
MIT License
20 stars 1 forks source link

Differentiate error messages on read and write #37

Closed sboyettedh closed 8 years ago

sboyettedh commented 8 years ago

Getting this on timeout

2015/12/22 21:20:32 conn 2 req 2 status 196 (failed to read mlen from socket); err: read tcp 10.243.187.22:61091->10.3.69.47:60906: i/o timeout

in a place where a write should be happening. Make sure that net read and write messages are differentiated and accurate.

firepear commented 8 years ago

Write err is now perr netwriteerr, code 197

firepear commented 8 years ago

Original instance is at 03-timeout_test.go: if msg.Code != 196 {

firepear commented 8 years ago

I believe that converting the error in h.send() from an old code 196 message to the new netwriteerr Perr instance fixes this bug. I also think the instance in test 03 is actually checking for the right thing (since 196 was/is read err) and there never was a test for code 197 since nothing was sending a 197.

Will close after fixups are complete and verified.

firepear commented 8 years ago

Looks good.