Changeset 7270432
- Timestamp:
- Jan 13, 2021, 1:38:12 PM (4 years ago)
- 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
- Location:
- benchmark/io/http
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/protocol.cfa
r075b8fd r7270432 48 48 // Call write 49 49 int ret = cfa_write(fd, it, len, 0, -1`s, 0p, 0p); 50 // int ret = write(fd, it, len); 50 51 if( ret < 0 ) { if( errno != EAGAIN && errno != EWOULDBLOCK) abort( "'answer error' error: (%d) %s\n", (int)errno, strerror(errno) ); } 51 52 … … 75 76 if( ret < 0 ) return ret; 76 77 return answer(fd, buffer, size); 78 } 79 80 int answer_empty( int fd ) { 81 return answer_header(fd, 0); 77 82 } 78 83 … … 115 120 116 121 void sendfile( int pipe[2], int fd, int ans_fd, size_t count ) { 122 unsigned sflags = SPLICE_F_MOVE; // | SPLICE_F_MORE; 117 123 off_t offset = 0; 118 124 ssize_t ret; 119 125 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); 121 128 if( ret < 0 ) { 122 129 if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE1; … … 128 135 size_t in_pipe = ret; 129 136 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); 131 139 if( ret < 0 ) { 132 140 if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE2; -
benchmark/io/http/protocol.hfa
r075b8fd r7270432 17 17 int answer_header( int fd, size_t size ); 18 18 int answer_plain( int fd, char buffer [], size_t size ); 19 int answer_empty( int fd ); 19 20 20 21 [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.