Oswald Buddenhagen
a55354516b
move responsibility for closing sockets on error to user
...
the only user being imap and the first thing in imap_cancel_store()
being a call to socket_close(), this code was pretty pointless anyway.
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
802c99edcf
make socket read/write error reporting callback-based
...
the functions still have synchronous return codes as well - this enables
early error returns without having to resort to refcounting.
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
f1df2f40d1
decouple the filling of the read buffer from consuming it
...
this prepares the code for being called from a callback.
notably, this makes the imap list parser have a "soft stack", so the
recursion can be suspended at any time.
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
f8d73ac346
make socket_write() capable of taking ownership of the buffer
...
that way the user code doesn't have to free it any more.
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
8a72d204c9
change socket_write() return code semantics
...
instead of returning a write()-like result, return only a binary status
code - write errors are handled internally anyway, so user code doesn't
have to check the write length.
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
171f7d6cd3
Socket_t + buffer_t => conn_t
...
remove the layering, in favor of a "buffered connection" abstraction.
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
3447694c2b
security fix: failure to load the certificate file is *not* OK ...
2012-09-01 16:03:36 +02:00
Oswald Buddenhagen
ef41349035
move socket code to a separate file
...
this makes the layering more obvious
2012-09-01 16:03:35 +02:00