Browse Source

more asserts and checks in stream_simple_socket

personal/stbuehler/wip
Stefan Bühler 9 years ago
parent
commit
c61f4929cb
  1. 2
      src/main/connection.c
  2. 4
      src/main/stream_simple_socket.c
  3. 1
      src/modules/mod_gnutls.c

2
src/main/connection.c

@ -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);
}

4
src/main/stream_simple_socket.c

@ -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 */

1
src/modules/mod_gnutls.c

@ -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