1.1 --- a/src/ltp.cc Thu Mar 27 20:37:19 2014 +0000
1.2 +++ b/src/ltp.cc Fri Mar 28 16:21:31 2014 +0000
1.3 @@ -221,6 +221,8 @@
1.4 #define LTP_STATE_CHANGED ltp_state_changed=true;
1.5
1.6 // SF MUDSAT testing: see what happens if I just set all the segments of this
1.7 +#define MUDSAT
1.8 +#ifdef MUDSAT
1.9 // all green block to indicate they were not sent, but just once
1.10 int green_re_tx_countdown=2; // move to "global" (gulp:-)
1.11
1.12 @@ -230,6 +232,8 @@
1.13 static int def_ciphersuite=LTP_CS_SIG;
1.14 static char *def_keyid="foo";
1.15
1.16 +#endif
1.17 +
1.18 /*!
1.19 * @fn ltp_instance ltp_next_instance(void)
1.20 * @return is a new (unused) instance number
1.21 @@ -347,6 +351,7 @@
1.22 * @section sfunctions static functions from here on down.
1.23 */
1.24
1.25 +#ifdef MUDSAT
1.26 // SF MUDSAT testing: see what happens if I just set all the segments of this
1.27 // all green block to indicate they were not sent, but just once
1.28 int ltp_green_re_tx(ltp_segment *seg)
1.29 @@ -367,6 +372,7 @@
1.30
1.31 return(LTP_OK);
1.32 }
1.33 +#endif
1.34
1.35 /*!
1.36 * @brief estimate the length of stuff extension encodings take up
1.37 @@ -704,8 +710,11 @@
1.38 *added_len+=ck->cval.len+10; // overestimate but ok
1.39 }
1.40
1.41 +#ifdef MUDSAT
1.42 // SF: MUDSAT - just keep any existing authenticators
1.43 // and don't recalculate 'em (nothing ought change I hope)
1.44 + // the code here really fixes a bug
1.45 +#endif
1.46 int already_authed=0;
1.47 for (int oe=0;oe!=seg->nexts;oe++) {
1.48 if (seg->exts[oe].type==LTPE_AUTH) {
1.49 @@ -776,9 +785,11 @@
1.50 theext->enclen=0;
1.51 theext->encval=NULL;
1.52 ptbuf.len+=kblen+10;
1.53 +#ifdef MUDSAT
1.54 // SF: MUDSAT testing - this is not an addition but a bugfix
1.55 // if there are existing extensions then we need to allow
1.56 // space for their encoding in the ptbuf
1.57 +#endif
1.58 int otherextslen=0;
1.59 for (int oe=0;oe!=seg->nexts;oe++) {
1.60 int a=seg->exts[oe].len;
1.61 @@ -2588,6 +2599,7 @@
1.62 sockets[nsockets-1].ltptrelay=false;
1.63 sockets[nsockets-1].close_called=false;
1.64
1.65 +#ifdef MUDSAT
1.66 // SF: MUDSAT - use default crypto
1.67 if (using_def_crypto==1) {
1.68 ltp_auth_so ov;
1.69 @@ -2601,6 +2613,7 @@
1.70 #endif
1.71 sockets[nsockets-1].opts.auth=ov;
1.72 }
1.73 +#endif
1.74
1.75 int rv=init_inactivity_timer(LTP_PARENT_SOCKET,(void*)&sockets[nsockets-1],false);
1.76 if (rv) {
1.77 @@ -4460,6 +4473,7 @@
1.78 lowlogscope(res.nscopes, res.lbs, res.ubs, __LINE__, LTP_SUB_SCOPES, 0);
1.79 #endif
1.80
1.81 +#ifdef MUDSAT
1.82 // SF: MUDSAT
1.83 // if there's a crypto cfg in the working directory then
1.84 // use that and set up a ciphersuite
1.85 @@ -4481,6 +4495,7 @@
1.86 ltp_log(LTP_LOG_MAX,ltpstr);
1.87 #endif
1.88 }
1.89 +#endif
1.90
1.91 return(LTP_OK);
1.92 }
1.93 @@ -5340,6 +5355,7 @@
1.94 && segments[i].seg.val.ds.eob) {
1.95 segments[i].parent->complete=true;
1.96
1.97 +#ifdef MUDSAT
1.98 // SF MUDSAT testing: see what happens if I just set all the segments of this
1.99 // all green block to indicate they were not sent, but just once
1.100 if (green_re_tx_countdown!=0) {
1.101 @@ -5347,6 +5363,7 @@
1.102 if (rtrv) LTPERR(rtrv);
1.103 green_re_tx_countdown--;
1.104 }
1.105 +#endif
1.106
1.107 }
1.108 // if that's the last regardless and the redpart is done then we're all done
1.109 @@ -5908,7 +5925,15 @@
1.110 theblock->complete=true;
1.111 }
1.112 if (theblock->eob_seen && (theblock->redtide==0 || theblock->redtide==LTP_REDTIDE_INIT)) { // all green
1.113 +#ifdef MUDSAT
1.114 + // SF: MUDSAT - with our 3 x Tx idea we can wait a bit
1.115 + // or... forever ;-) TODO: add a timer
1.116 + if (complete_scope(theblock)) {
1.117 + theblock->complete=true;
1.118 + }
1.119 +#else
1.120 theblock->complete=true;
1.121 +#endif
1.122 // so it'll be finishedwithwhendelivered if its for me
1.123 }
1.124