Echo server should shutdown instead of close

This commit is contained in:
Bert Belder 2011-05-04 03:59:35 +02:00
parent 67b63c47b5
commit 0d28b9e549

View File

@ -57,8 +57,14 @@ void after_write(oio_req* req, int status) {
}
void after_shutdown(oio_req* req, int status) {
free(req);
}
void after_read(oio_handle* handle, int nread, oio_buf buf) {
write_req_t *wr;
oio_req* req;
if (nread < 0) {
/* Error or EOF */
@ -68,7 +74,10 @@ void after_read(oio_handle* handle, int nread, oio_buf buf) {
free(buf.base);
}
oio_close(handle);
req = (oio_req*) malloc(sizeof *req);
oio_req_init(req, handle, after_shutdown);
oio_shutdown(req);
return;
}