Ignore:
Timestamp:
Jan 9, 2021, 4:27:57 PM (3 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:
561dd26
Parents:
35fd2c4
Message:

Added prints.
Naive implementation of cancel.
Server now shutdown cleanly.

File:
1 edited

Legend:

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

    r35fd2c4 rece0e80  
    7171}
    7272
    73 [HttpCode code, bool closed, * const char file, size_t len] http_read(int fd, []char buffer, size_t len) {
     73[HttpCode code, bool closed, * const char file, size_t len] http_read(int fd, []char buffer, size_t len, io_cancellation * cancel) {
    7474        char * it = buffer;
    7575        size_t count = len - 1;
     
    7777        READ:
    7878        for() {
    79                 int ret = cfa_read(fd, (void*)it, count, 0, -1`s, 0p, 0p);
     79                int ret = cfa_read(fd, (void*)it, count, 0, -1`s, cancel, 0p);
    8080                // int ret = read(fd, (void*)it, count);
    8181                if(ret == 0 ) return [OK200, true, 0, 0];
     
    148148
    149149void ?{}( DateFormater & this ) {
    150         ((thread&)this){ *options.clopts.instance };
     150        ((thread&)this){ "Server Date Thread", *options.clopts.instance };
    151151        this.idx = 0;
    152152        memset( this.buffers[0].buff, 0, sizeof(this.buffers[0]) );
     
    162162
    163163                Time now = getTimeNsec();
    164                 // Date: Wed, 17 Apr 2013 12:00:00 GMT
     164
    165165                strftime( this.buffers[this.idx].buff, 100, "%a, %d %b %Y %H:%M:%S %Z", now );
    166                 printf("Changing date to %s\n", this.buffers[this.idx].buff);
    167166
    168167                char * next = this.buffers[this.idx].buff;
Note: See TracChangeset for help on using the changeset viewer.