Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
stash! fixes before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
badrock committed May 30, 2014
1 parent 35e942d commit 1282171
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 24 deletions.
4 changes: 2 additions & 2 deletions SConstruct
Expand Up @@ -165,6 +165,6 @@ Export("libs")
Export("linkflags")
Export("DEBUG")
Export("CODECOVERAGE")
# Arno: uncomment to build tests
SConscript('tests/SConscript')
# Uncomment the following line to build the tests
#SConscript('tests/SConscript')

5 changes: 3 additions & 2 deletions TODO
@@ -1,14 +1,15 @@
NEW FIXES:
* RTT calculation with network burst
* RTT sender >= owd
* multiple samples for ledbat calculations
* flow control
* state machine changes

OUTDATED:

STATE MACHINE
* imposed HINTs are terribly broken, resent for the data in flight
* check ACK/HAVE redundancy
* HAVE overuses find_filtered
* set priorities on ranges
* small-progress update problem (aka peer nap)
guarantee size of updates < x% of data, on both ends
* pex is affected by peer nap
Expand Down
9 changes: 4 additions & 5 deletions cmdgw.cpp
Expand Up @@ -69,9 +69,9 @@ struct evbuffer *cmd_evbuffer = NULL; // Data received on cmd socket : WARNING:
/*
* SOCKTUNNEL
* We added the ability for a process to tunnel data over swift's UDP socket.
* The process should send TUNNELSEND commands over the CMD TCP socket and will
* receive TUNNELRECV commands from swift, containing data received via UDP
* on channel 0xffffffff.
* The process should send TUNNELSUSCRIBE (with a chosen prefix) and TUNNELSEND
* commands over the CMD * TCP socket. It will than receive TUNNELRECV commands
* from swift.
*/
typedef enum {
CMDGW_TUNNEL_SCAN4CRLF,
Expand Down Expand Up @@ -736,7 +736,6 @@ int CmdGwHandleCommand(evutil_socket_t cmdsock, char *copyline)
//fprintf(stderr,"cmd: START: new request %i\n",cmd_gw_reqs_count+1);

// Format: START url destdir [metadir]\r\n
// Arno, 2012-04-13: See if URL followed by storagepath, and metadir for seeding
std::string pstr = paramstr;
std::string url="",storagepath="", metadir="";
int sidx = pstr.find(" ");
Expand Down Expand Up @@ -1179,7 +1178,7 @@ bool InstallCmdGateway (struct event_base *evbase,Address cmdaddr,Address httpad

// SOCKTUNNEL
bool swift::CmdGwTunnelCheckChannel(uint32_t channel) {
// returns true is the channel is used for tunneling messages through channels
// returns true is the channel/prefix is used for tunneling messages through channels
for (std::vector<uint32_t>::iterator it = tunnel_channels_.begin(); it != tunnel_channels_.end(); ++it)
if (*it == channel)
return true;
Expand Down
6 changes: 2 additions & 4 deletions ext/seq_picker.cpp
Expand Up @@ -55,11 +55,9 @@ class SeqPiecePicker : public PiecePicker {
// return bin64_t(0,(hashtree()->size()>>10)-1); // dirty
}
retry: // bite me
// Ric: test.. just linear
//twist_ &= (hashtree()->peak(0).toUInt()) & ((1<<6)-1);
twist_ &= (hashtree()->peak(0).toUInt()) & ((1<<6)-1);

//bin_t hint = binmap_t::find_complement(ack_hint_out_, offer, twist_);
bin_t hint = binmap_t::find_complement(ack_hint_out_, offer, 0);
bin_t hint = binmap_t::find_complement(ack_hint_out_, offer, twist_);

if (hint.is_none()) {
return hint; // TODO: end-game mode
Expand Down
8 changes: 2 additions & 6 deletions send_control.cpp
Expand Up @@ -94,14 +94,9 @@ tint Channel::KeepAliveNextSendTime () {
mode, the next packet will be pushed further and further into the future, which is
not what we want. The scheduled time for the next packet should be unchanged
on reception."
----------------
Ric: check if we still needed. Now I perform the check for previously scheduled
events in reschedule(). Commented
*/
if (!reverse_pex_out_.empty())
return reverse_pex_out_.front().time;
//if (NOW < next_send_time_)
// return next_send_time_;

// Arno: Fix that doesn't do exponential growth always, only after sends
// without following recvs
Expand Down Expand Up @@ -276,7 +271,8 @@ tint Channel::LedbatNextSendTime () {
}

/*Arno, 2012-02-02: Somehow LEDBAT gets stuck at cwnd_ == 1 sometimes
// This hack appears to work to get it back on the right track quickly.
This hack appears to work to get it back on the right track quickly.
* Ric: not really needed.. it should not happen at all!
if (oldcwnd == 1 && cwnd_ == 1)
cwnd_count1_++;
else
Expand Down
6 changes: 3 additions & 3 deletions sendrecv.cpp
Expand Up @@ -205,11 +205,11 @@ void Channel::AddLiveSignedMunroHash(struct evbuffer *evb, bin_t munro)
void Channel::AddFileUncleHashes (struct evbuffer *evb, bin_t pos) {
bin_t peak = hashtree()->peak_for(pos);
binvector bv;
//while (pos!=peak && ((NOW&3)==3 || !pos.parent().contains(data_out_cap_)) &&
// ack_in_.is_empty(pos.parent()) ) {
while (pos!=peak && ((NOW&3)==3 || !pos.parent().contains(data_out_cap_)) &&
ack_in_.is_empty(pos.parent()) ) {
// Ric: TODO optimise.. send based on pkt loss statistics
// the above is correct but should not happen at the beginning!
while (pos!=peak && ack_in_.is_empty(pos.parent()) ) {
//while (pos!=peak && ack_in_.is_empty(pos.parent()) ) {
bin_t uncle = pos.sibling();
bv.push_back(uncle);
pos = pos.parent();
Expand Down
3 changes: 1 addition & 2 deletions storage.cpp
Expand Up @@ -56,7 +56,6 @@ Storage::Storage(std::string ospathname, std::string destdir, int td, uint64_t l
return;
}
}
dprintf("\n\naooo\n%s\n", filename.c_str());

// File exists. Check first bytes to see if a multifile-spec
FILE *fp = fopen_utf8(filename.c_str(),"rb");
Expand All @@ -76,7 +75,7 @@ Storage::Storage(std::string ospathname, std::string destdir, int td, uint64_t l
SetBroken();
return;
}
dprintf("\n\naooo\n%s\n", filename.c_str());

if (!strncmp(readbuf,MULTIFILE_PATHNAME.c_str(),MULTIFILE_PATHNAME.length()))
{
// Pathname points to a multi-file spec, assume we're seeding
Expand Down

0 comments on commit 1282171

Please sign in to comment.