Changeset 7270432


Ignore:
Timestamp:
Jan 13, 2021, 1:38:12 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
97748ee
Parents:
075b8fd
Message:

Splice no longer uses SPLICE_F_MORE.
Added answer_empty

Location:
benchmark/io/http
Files:
2 edited

Legend:

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

    r075b8fd r7270432  
    4848                // Call write
    4949                int ret = cfa_write(fd, it, len, 0, -1`s, 0p, 0p);
     50                // int ret = write(fd, it, len);
    5051                if( ret < 0 ) { if( errno != EAGAIN && errno != EWOULDBLOCK) abort( "'answer error' error: (%d) %s\n", (int)errno, strerror(errno) ); }
    5152
     
    7576        if( ret < 0 ) return ret;
    7677        return answer(fd, buffer, size);
     78}
     79
     80int answer_empty( int fd ) {
     81        return answer_header(fd, 0);
    7782}
    7883
     
    115120
    116121void sendfile( int pipe[2], int fd, int ans_fd, size_t count ) {
     122        unsigned sflags = SPLICE_F_MOVE; // | SPLICE_F_MORE;
    117123        off_t offset = 0;
    118124        ssize_t ret;
    119125        SPLICE1: while(count > 0) {
    120                 ret = cfa_splice(ans_fd, &offset, pipe[1], 0p, count, SPLICE_F_MOVE | SPLICE_F_MORE, 0, -1`s, 0p, 0p);
     126                ret = cfa_splice(ans_fd, &offset, pipe[1], 0p, count, sflags, 0, -1`s, 0p, 0p);
     127                // ret = splice(ans_fd, &offset, pipe[1], 0p, count, sflags);
    121128                if( ret < 0 ) {
    122129                        if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE1;
     
    128135                size_t in_pipe = ret;
    129136                SPLICE2: while(in_pipe > 0) {
    130                         ret = cfa_splice(pipe[0], 0p, fd, 0p, in_pipe, SPLICE_F_MOVE | SPLICE_F_MORE, 0, -1`s, 0p, 0p);
     137                        ret = cfa_splice(pipe[0], 0p, fd, 0p, in_pipe, sflags, 0, -1`s, 0p, 0p);
     138                        // ret = splice(pipe[0], 0p, fd, 0p, in_pipe, sflags);
    131139                        if( ret < 0 ) {
    132140                                if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE2;
  • benchmark/io/http/protocol.hfa

    r075b8fd r7270432  
    1717int answer_header( int fd, size_t size );
    1818int answer_plain( int fd, char buffer [], size_t size );
     19int answer_empty( int fd );
    1920
    2021[HttpCode code, bool closed, * const char file, size_t len] http_read(int fd, []char buffer, size_t len, io_cancellation *);
Note: See TracChangeset for help on using the changeset viewer.