mirror of /home/gitosis/repositories/libowfat.git
add iob test
This commit is contained in:
parent
533b9cadc0
commit
63149c4ed9
|
@ -51,7 +51,7 @@ int64 iob_send(int64 s,io_batch* b) {
|
|||
}
|
||||
hdr.headers=v; hdr.hdr_cnt=headers;
|
||||
hdr.trailers=v+headers; hdr.trl_cnt=trailers;
|
||||
r=sendfile(e[headers].fd,s,e[headers].offset,e[headers].bytes,&hdr,&sbytes,0);
|
||||
r=sendfile(e[headers].fd,s,e[headers].offset,e[headers].n,&hdr,&sbytes,0);
|
||||
if (r==0)
|
||||
sent=b->bytesleft;
|
||||
else if (r==-1 && errno==EAGAIN)
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#include <assert.h>
|
||||
#include "iob.h"
|
||||
|
||||
main() {
|
||||
int64 fd;
|
||||
io_batch* b;
|
||||
assert(io_readfile(&fd,"GNUmakefile"));
|
||||
assert(b=iob_new(10));
|
||||
assert(iob_addbuf(b,"Huhu",4));
|
||||
assert(iob_addbuf(b," fnord\n",7));
|
||||
assert(iob_addfile(b,fd,10,10));
|
||||
iob_send(1,b);
|
||||
}
|
Loading…
Reference in New Issue