Commit Graph

15 Commits

Author SHA1 Message Date
Pieter Noordhuis
5f1ed96692 Order of includes doesn't matter in tests either 2012-08-14 09:28:51 -07:00
Pieter Noordhuis
d0b6b9ab76 Remove fmacros.h 2012-08-14 09:26:09 -07:00
Pieter Noordhuis
fde8520274 Adapt tests to new source layout 2012-06-08 16:32:08 -07:00
Pieter Noordhuis
993981a0d3 Keep track of bytes per callback
This allows to drop the requirement that the request itself is
responsible for keeping track of the number of bytes it has emitted via
`write_ptr` and the number of bytes that were actually written in
`write_cb`. The request queue now lets the request know how many bytes
have been written on its account, instead of asking for it.
2012-03-06 13:20:19 -08:00
Pieter Noordhuis
2ef4a5be15 Test write callback for empty requests 2012-03-06 11:56:03 -08:00
Pieter Noordhuis
50c41814a8 Factor out test setup macro 2012-03-06 11:55:06 -08:00
Pieter Noordhuis
2a37c4a100 Allow sentinel requests in request queue 2012-03-06 11:39:59 -08:00
Pieter Noordhuis
b71887216d Request queue is responsible for parsing replies
The change in d0eb3f65 moved responsibility to the request itself, but
kept ownership of the parser struct with the request queue. In
retrospect, it is cleaner to keep protocol parsing in the queue and have
it pass the parsed protocol via the read callback.
2012-03-06 11:05:32 -08:00
Pieter Noordhuis
796b2f1f51 Add I/O hooks to request queue 2012-03-05 23:42:28 -08:00
Pieter Noordhuis
fce264e385 Test *_done fields being set on request struct 2012-01-10 13:13:48 -08:00
Pieter Noordhuis
125cf58cec Simultaneous writes and reads for requests in the queue
Every request is now kept in a maximum of two queues. When a request is
initially inserted, it is inserted in the `to_write` queue. When at
least one write buffer is extracted from that request, it is *moved* to
the `wait_write` queue. When at least one byte of the request has been
written to the socket, it is *also* placed in the `wait_read` queue.

This means that it is possible for a request to be emitting write
buffers, while simultaneously receiving read callbacks.
2012-01-10 12:01:05 -08:00
Pieter Noordhuis
6138ef4aca Use done ptr to signal done in write_ptr function 2012-01-10 09:54:13 -08:00
Pieter Noordhuis
d0eb3f6511 Request is responsible for parsing its own reply 2012-01-10 09:24:44 -08:00
Pieter Noordhuis
6c990440ee No return value for request queue insert 2012-01-09 16:44:51 -08:00
Pieter Noordhuis
ee99d5a3d1 Request queue
The request queue abstraction intends to provide an interface usable
by asynchronous I/O libraries, without making assumptions about their
interfaces.
2012-01-06 17:29:34 -08:00