diff options
author | Eric Wong <normalperson@yhbt.net> | 2012-02-27 21:11:12 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2012-02-27 21:11:12 +0000 |
commit | 20428cf11e06b5d9854b3f79d27eb3844e768e96 (patch) | |
tree | 2fa2caf1ecad24896ae51b1bfc0e5808ae725543 /http.c | |
parent | 920ba3f726684a3c95d323669004ab456c834b58 (diff) | |
download | cmogstored-20428cf11e06b5d9854b3f79d27eb3844e768e96.tar.gz |
This stores the original size of the struct and makes it easier to know how much of it is used.
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -30,8 +30,6 @@ http_defer_rbuf(struct mog_http *http, struct mog_rbuf *rbuf, size_t buf_len) } else { http->rbuf = mog_rbuf_new(MOG_HTTP_RBUF_SIZE); memcpy(http->rbuf->rptr, src, defer_bytes); - - /* DANGER: we'll set this back to MOG_HTTP_RBUF_SIZE later: */ http->rbuf->rsize = defer_bytes; } http->offset = 0; @@ -119,7 +117,7 @@ static enum mog_next http_queue_step(struct mog_fd *mfd) if (http->rbuf) { /* request got pipelined, resuming now */ buf_len = http->rbuf->rsize; - http->rbuf->rsize = capa; /* DANGER see http_defer_rbuf */ + http->rbuf->rsize = http->rbuf->rcapa; assert(http->offset <= buf_len && "bad offset from pipelining"); if (http->offset < buf_len) goto parse; @@ -170,7 +168,7 @@ parse: if (buf_len > 0) { if (http->rbuf == NULL) http->rbuf = mog_rbuf_defer(rbuf); - http->rbuf->rsize = buf_len; /* DANGER */ + http->rbuf->rsize = buf_len; } return MOG_NEXT_WAIT_RD; case EINTR: goto reread; |