Ignore:
Timestamp:
Aug 28, 2020, 1:26:28 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:
8e3034d
Parents:
8e2cb4a
Message:

Fixed some compilation errors.
Fixed file descriptor support in progress.

File:
1 edited

Legend:

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

    r8e2cb4a rd11d6eb  
    1111extern "C" {
    1212      int snprintf ( char * s, size_t n, const char * format, ... );
     13        #include <linux/io_uring.h>
    1314}
    1415#include <string.h>
    15 
    1616#include <errno.h>
    1717
     18#include "options.hfa"
    1819
    1920const char * http_msgs[] = {
     
    7475        READ:
    7576        for() {
    76                 int ret = cfa_read(fd, it, count);
    77                 if(ret == 0 ) return [OK200, true, 0p, 0];
     77                int ret = cfa_read(fd, (void*)it, count, 0, -1`s, 0p, 0p);
     78                if(ret == 0 ) return [OK200, true, 0, 0];
    7879                if(ret < 0 ) {
    7980                        if( errno == EAGAIN || errno == EWOULDBLOCK) continue READ;
     
    8889                count -= ret;
    8990
    90                 if( count < 1 ) return [E414, false, 0p, 0];
     91                if( count < 1 ) return [E414, false, 0, 0];
    9192        }
    9293
     
    9596        it = buffer;
    9697        int ret = memcmp(it, "GET /", 5);
    97         if( ret != 0 ) return [E400, false, 0p, 0];
     98        if( ret != 0 ) return [E400, false, 0, 0];
    9899        it += 5;
    99100
     
    106107        ssize_t ret;
    107108        SPLICE1: while(count > 0) {
    108                 ret = cfa_splice(ans_fd, &offset, pipe[1], 0p, count, SPLICE_F_MOVE | SPLICE_F_MORE);
     109                ret = cfa_splice(ans_fd, &offset, pipe[1], 0p, count, SPLICE_F_MOVE | SPLICE_F_MORE, 0, -1`s, 0p, 0p);
    109110                if( ret < 0 ) {
    110111                        if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE1;
     
    116117                size_t in_pipe = ret;
    117118                SPLICE2: while(in_pipe > 0) {
    118                         ret = cfa_splice(pipe[0], 0p, fd, 0p, in_pipe, SPLICE_F_MOVE | SPLICE_F_MORE);
     119                        ret = cfa_splice(pipe[0], 0p, fd, 0p, in_pipe, SPLICE_F_MOVE | SPLICE_F_MORE, 0, -1`s, 0p, 0p);
    119120                        if( ret < 0 ) {
    120121                                if( errno != EAGAIN && errno != EWOULDBLOCK) continue SPLICE2;
Note: See TracChangeset for help on using the changeset viewer.