Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/protocol.cfa

    ref3c383 r644162a  
    2424
    2525#include "options.hfa"
    26 #include "worker.hfa"
    2726
    2827#define PLAINTEXT_1WRITE
     
    157156
    158157                count -= ret;
     158                offset += ret;
    159159                size_t in_pipe = ret;
    160160                SPLICE2: while(in_pipe > 0) {
     
    266266}
    267267
    268 static inline int wait_and_process(header_g & this, sendfile_stats_t & stats) {
     268static inline int wait_and_process(header_g & this) {
    269269        wait(this.f);
    270270
     
    295295        }
    296296
    297         stats.header++;
    298 
    299297        // It must be a Short read
    300298        this.len  -= this.f.result;
     
    308306        io_future_t f;
    309307        int fd; int pipe; size_t len; off_t off;
    310         short zipf_idx;
    311308        FSM_Result res;
    312309};
     
    317314        this.len = len;
    318315        this.off = 0;
    319         this.zipf_idx = -1;
    320         STATS: for(i; zipf_cnts) {
    321                 if(len <= zipf_sizes[i]) {
    322                         this.zipf_idx = i;
    323                         break STATS;
    324                 }
    325         }
    326         if(this.zipf_idx < 0) mutex(serr) serr | "SPLICE IN" | len | " greated than biggest zipf file";
    327316}
    328317
     
    340329}
    341330
    342 static inline int wait_and_process(splice_in_t & this, sendfile_stats_t & stats ) {
     331static inline int wait_and_process(splice_in_t & this) {
    343332        wait(this.f);
    344333
     
    356345                        return error(this.res, -ECONNRESET);
    357346                }
    358                 mutex(serr) serr | "SPLICE IN got" | error | ", WTF!";
    359                 return error(this.res, -ECONNRESET);
    360347        }
    361348
     
    370357                return done(this.res);
    371358        }
    372 
    373         stats.splcin++;
    374         stats.avgrd[this.zipf_idx].calls++;
    375         stats.avgrd[this.zipf_idx].bytes += this.f.result;
    376359
    377360        // It must be a Short read
     
    415398}
    416399
    417 static inline void wait_and_process(splice_out_g & this, sendfile_stats_t & stats ) {
     400static inline void wait_and_process(splice_out_g & this) {
    418401        wait(this.f);
    419402
     
    431414                        return error(this, -ECONNRESET);
    432415                }
    433                 mutex(serr) serr | "SPLICE OUT got" | error | ", WTF!";
    434                 return error(this, -ECONNRESET);
    435416        }
    436417
     
    447428
    448429SHORT_WRITE:
    449         stats.splcot++;
    450 
    451430        // It must be a Short Write
    452431        this.len -= this.f.result;
     
    455434}
    456435
    457 int answer_sendfile( int pipe[2], int fd, int ans_fd, size_t fsize, sendfile_stats_t & stats ) {
    458         stats.calls++;
     436int answer_sendfile( int pipe[2], int fd, int ans_fd, size_t fsize ) {
    459437        #if defined(LINKED_IO)
    460438                char buffer[512];
     
    465443
    466444                RETRY_LOOP: for() {
    467                         stats.tries++;
    468445                        int have = need(header.res) + need(splice_in.res) + 1;
    469446                        int idx = 0;
     
    484461                        // we may need to kill the connection if it fails
    485462                        // If it already completed, this is a no-op
    486                         wait_and_process(splice_in, stats);
     463                        wait_and_process(splice_in);
    487464
    488465                        if(is_error(splice_in.res)) {
     
    492469
    493470                        // Process the other 2
    494                         wait_and_process(header, stats);
    495                         wait_and_process(splice_out, stats);
     471                        wait_and_process(header);
     472                        wait_and_process(splice_out);
    496473
    497474                        if(is_done(splice_out.res)) {
     
    513490                return len + fsize;
    514491        #else
    515                 stats.tries++;
    516492                int ret = answer_header(fd, fsize);
    517493                if( ret < 0 ) { close(fd); return ret; }
Note: See TracChangeset for help on using the changeset viewer.