more asserts and checks in stream_simple_socket

personal/stbuehler/wip
Stefan Bühler 10 years ago
parent b6325775dc
commit c61f4929cb

@ -160,11 +160,13 @@ static void con_iostream_close(liConnection *con) { /* force close */
con->info.aborted = TRUE;
con->con_sock.callbacks->finish(con, TRUE);
}
assert(NULL == con->con_sock.data);
}
static void con_iostream_shutdown(liConnection *con) { /* (try) regular shutdown */
if (con->con_sock.callbacks) {
con->con_sock.callbacks->finish(con, FALSE);
}
assert(NULL == con->con_sock.data);
}

@ -108,11 +108,11 @@ static void stream_simple_socket_write_throttle_notify(liThrottleState *state, g
static void stream_simple_socket_write(liIOStream *stream) {
liNetworkStatus res;
liChunkQueue *raw_out = stream->stream_out.out;
liChunkQueue *from = stream->stream_out.source->out;
liChunkQueue *from = (NULL != stream->stream_out.source) ? stream->stream_out.source->out : NULL;
int fd = li_event_io_fd(&stream->io_watcher);
liWorker *wrk = li_worker_from_iostream(stream);
li_chunkqueue_steal_all(raw_out, from);
if (NULL != from) li_chunkqueue_steal_all(raw_out, from);
if (raw_out->length > 0) {
static const goffset WRITE_MAX = 256*1024; /* 256kB */

@ -197,6 +197,7 @@ static void gnutlc_tcp_finished(liConnection *con, gboolean aborted) {
if (NULL != conctx) {
assert(con == conctx->con);
close_cb(conctx->tls_filter, conctx);
assert(NULL == con->con_sock.data);
}
{

Loading…
Cancel
Save