Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1368e42 authored by Lajos Molnar's avatar Lajos Molnar Committed by Gerrit Code Review
Browse files

Merge "VT: do not remove a rx session even if ECONNREFUSED occurred."

parents 96f5c78c 0d9fa6df
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -508,8 +508,6 @@ void ARTPConnection::onPollStreams() {
                    if (n != (ssize_t)buffer->size()) {
                        ALOGW("failed to send RTCP TMMBR (%s).",
                                n >= 0 ? "connection gone" : strerror(errno));

                        it = mStreams.erase(it);
                        continue;
                    }
                }
@@ -560,8 +558,6 @@ void ARTPConnection::onPollStreams() {
                if (n != (ssize_t)buffer->size()) {
                    ALOGW("failed to send RTCP receiver report (%s).",
                            n >= 0 ? "connection gone" : strerror(errno));

                    it = mStreams.erase(it);
                    continue;
                }

@@ -621,8 +617,15 @@ status_t ARTPConnection::receive(StreamInfo *s, bool receiveRTP) {
    } while (nbytes < 0 && errno == EINTR);

    if (nbytes <= 0) {
        ALOGW("failed to recv rtp packet. cause=%s", strerror(errno));
        // ECONNREFUSED may happen in next recvfrom() calling if one of
        // outgoing packet can not be delivered to remote by using sendto()
        if (errno == ECONNREFUSED) {
            return -ECONNREFUSED;
        } else {
            return -ECONNRESET;
        }
    }

    buffer->setRange(0, nbytes);

@@ -665,6 +668,10 @@ ssize_t ARTPConnection::send(const StreamInfo *info, const sp<ABuffer> buffer) {
                    pRemoteRTCPAddr, sizeSockSt);
        } while (n < 0 && errno == EINTR);

        if (n < 0) {
            ALOGW("failed to send rtcp packet. cause=%s", strerror(errno));
        }

        return n;
}