Commit bb457216 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix possibly uninitialized warning in feedbackReceiver.

parent 10bfc757
Pipeline #141 passed with stage
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
void handle_feedback(PrrtSocket *prrtSocket, const size_t length) void handle_feedback(PrrtSocket *prrtSocket, const size_t length)
{ {
char bufin[MAX_PAYLOAD_LENGTH]; char bufin[MAX_PAYLOAD_LENGTH];
PrrtPacket *prrtPacket = NULL;
ssize_t n; ssize_t n;
struct sockaddr_in remote; struct sockaddr_in remote;
socklen_t addrlen = sizeof(remote); socklen_t addrlen = sizeof(remote);
...@@ -32,15 +33,10 @@ void handle_feedback(PrrtSocket *prrtSocket, const size_t length) ...@@ -32,15 +33,10 @@ void handle_feedback(PrrtSocket *prrtSocket, const size_t length)
n = recvfrom(prrtSocket->feedbackSocketFd, bufin, length, 0, (struct sockaddr *) &remote, &addrlen); n = recvfrom(prrtSocket->feedbackSocketFd, bufin, length, 0, (struct sockaddr *) &remote, &addrlen);
check(n >= 0, "Receiving feedback failed."); check(n >= 0, "Receiving feedback failed.");
PrrtPacket *prrtPacket = calloc(1, sizeof(PrrtPacket)); prrtPacket = calloc(1, sizeof(PrrtPacket));
check_mem(prrtPacket); check_mem(prrtPacket);
PrrtPacket_decode(bufin, (uint16_t) n, prrtPacket); PrrtPacket_decode(bufin, (uint16_t) n, prrtPacket);
//PrrtPacketFeedbackPayload* payload = prrtPacket->payload;
//struct in_addr a;
//a.s_addr = payload->receiverAddress;
//debug("Receiver Address: %s", inet_ntoa(a));
prrtTimestamp_t forwardTripTimestamp = ((PrrtPacketFeedbackPayload *) prrtPacket->payload)->forwardTripTimestamp_us; prrtTimestamp_t forwardTripTimestamp = ((PrrtPacketFeedbackPayload *) prrtPacket->payload)->forwardTripTimestamp_us;
PrrtChannelStateInformation_update_rtt(prrtSocket->csi, (prrtTimedelta_t) (receiveTime - forwardTripTimestamp)); PrrtChannelStateInformation_update_rtt(prrtSocket->csi, (prrtTimedelta_t) (receiveTime - forwardTripTimestamp));
...@@ -66,6 +62,6 @@ void *receive_feedback_loop(void *ptr) ...@@ -66,6 +62,6 @@ void *receive_feedback_loop(void *ptr)
return NULL; return NULL;
error: error:
PERROR("Feedback reception failed."); PERROR("Feedback reception failed.%s","");
return NULL; return NULL;
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment