X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=utcp.c;h=391706f1d1abdee0ecf8a8edf7b2dc45f6cdd40d;hb=36555fb967087c22ec8854b4cad158f7d2688c5b;hp=df2a31ec6a5f7bcad210170eace9a7dda4a78c8e;hpb=d6fd886cef9bc465c03a95e9b89f44b2810066aa;p=utcp diff --git a/utcp.c b/utcp.c index df2a31e..391706f 100644 --- a/utcp.c +++ b/utcp.c @@ -130,13 +130,11 @@ static ssize_t buffer_put(struct buffer *buf, const void *data, size_t len) { if(newsize > buf->maxsize) newsize = buf->maxsize; char *newdata = realloc(buf->data, newsize); - fprintf(stderr, "%p = realloc(%p, %zu)\n", newdata, buf->data, newsize); if(!newdata) return -1; buf->data = newdata; buf->size = newsize; } - fprintf(stderr, "memcpy(%p, %p, %zu)\n", buf->data + buf->used, data, len); memcpy(buf->data + buf->used, data, len); buf->used += len; return len; @@ -803,7 +801,6 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { rxd = c->recv(c, data, len); if(rxd != len) { // TODO: once we have a receive buffer, handle the application not accepting all data. - fprintf(stderr, "c->recv(%p, %p, %zu) returned %zd\n", c, data, len, rxd); abort(); } if(rxd < 0) @@ -933,6 +930,8 @@ int utcp_shutdown(struct utcp_connection *c, int dir) { int utcp_close(struct utcp_connection *c) { if(utcp_shutdown(c, SHUT_RDWR)) return -1; + c->recv = NULL; + c->poll = NULL; c->reapable = true; return 0; } @@ -949,6 +948,8 @@ int utcp_abort(struct utcp_connection *c) { return -1; } + c->recv = NULL; + c->poll = NULL; c->reapable = true; switch(c->state) {