]> git.sesse.net Git - greproxy/blobdiff - rsdecoder.cpp
Merge branch 'master' of /srv/git.sesse.net/www/greproxy
[greproxy] / rsdecoder.cpp
index 14527ca06cea226d9ad0dff1e1a458a0e82564a8..0a11541c377a595a1ce7cfcffff9421656817a6e 100644 (file)
@@ -17,7 +17,7 @@ RSDecoder::RSDecoder(Sender *sender)
 {
 }
 
-void RSDecoder::send_packet(uint16_t proto, const std::string &data, int incoming_seq)
+void RSDecoder::send_packet(uint16_t proto, const std::string &data, uint32_t incoming_seq)
 {
        int rs_group;
        if (proto == 0xffff) {
@@ -85,7 +85,7 @@ void RSDecoder::send_packet(uint16_t proto, const std::string &data, int incomin
                        vector<string> padded_packets;
                        std::map<size_t, const fecpp::byte *> shares;
                        for (const auto &packet_pair : group.packets) {
-                               int packet_seq = packet_pair.first;
+                               uint32_t packet_seq = packet_pair.first;
                                int share_num;
                                string p;
                                p.resize(max_length);
@@ -124,7 +124,7 @@ void RSDecoder::send_packet(uint16_t proto, const std::string &data, int incomin
                                printf("Reconstructed packet %d (proto=0x%04x len=%d, data=%02x %02x %02x %02x %02x %02x %02x %02x)\n", packet_num,
                                         ntohs(proto_be), ntohs(len_be),
                                        ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]);
-
+                               ++num_recovered_packets;
                        });
                }