Closed Bug 799892 Opened 8 years ago Closed 8 years ago
Channel Connection::Send Blob can return nsresult instead of int32 _t
Bug 729512 added netwerk/sctp/datachannel/DataChannel.cpp, which contains DataChannelConnection::SendBlob, which has return type int32_t. It contains the following: nsresult rv = NS_ReadInputStreamToString(aBlob, *temp, len); NS_ENSURE_SUCCESS(rv, rv); This is an error -- it will return rv, which is an nsresult. I don't see any docs at a quick glance, but I'm guessing the return type is meant to be the number of bytes sent, so 0 is the right thing to return in case of error. An error nsresult winds up being negative when converted silently to int32_t, which probably isn't intended. This doesn't compile when nsresult is converted to enum class (bug 779473).
Given that we've been asked to cut back on try runs to conserve resources for the time being, I don't think this needs a try push. Let me know if you'd like one (or if you'd like the patch done differently).
Attachment #669913 - Flags: review?(mcmanus)
Attachment #669913 - Flags: review?(mcmanus) → review+
Comment on attachment 669913 [details] [diff] [review] Patch Thanks, Aryeh. Cut-and-paste error when copying code from WebSockets, where it was used in a slightly different context.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.