1. tm512
  2. ispolin

Commits

tm512  committed e492842

Properly tally bandwidth

  • Participants
  • Parent commits f65dc31
  • Branches master

Comments (0)

Files changed (1)

File src/net.c

View file
 				return -1;
 		}
 		else
+		{
 			totalSent += tempSent;
+			net_sent += tempSent;
+		}
 	}
 
-	net_sent += totalSent;
 	return len - totalSent;
 }
 
 			if ((errno != EWOULDBLOCK && errno != EAGAIN) || !tempRecv)
 				return -1;
 			else
-		//		return 0;
 				break;
 		}
 		else
+		{
 			totalRecv += tempRecv;
+			net_recvd += tempRecv;
+		}
 	}
 
-	net_recvd += totalRecv;
 	return totalRecv;
 }