kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 7e8371366fe84309f7bf8d1ca3f3a9a954833c7f
parent b64f674db22fa27d061c82046064a9c2b0c2b8f7
Author: Joris Vink <joris@coders.se>
Date:   Tue, 14 Jan 2014 22:22:26 +0100

Make sure we properly close a SPDY stream if there's no data.

Diffstat:
src/http.c | 2+-
src/spdy.c | 9++++++---
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/http.c b/src/http.c @@ -306,7 +306,7 @@ http_response(struct http_request *req, int status, u_int8_t *d, u_int32_t len) kore_mem_free(htext); if (len > 0) { - req->stream->send_size = len; + req->stream->send_size += len; spdy_frame_send(req->owner, SPDY_DATA_FRAME, 0, len, req->stream, 0); net_send_queue(req->owner, d, len, req->stream); diff --git a/src/spdy.c b/src/spdy.c @@ -181,10 +181,13 @@ spdy_frame_send(struct connection *c, u_int16_t type, u_int8_t flags, break; } - if (s != NULL && type == SPDY_DATA_FRAME && (flags & FLAG_FIN)) + if (s != NULL && type == SPDY_DATA_FRAME && (flags & FLAG_FIN)) { + s->send_size += length; s->flags |= SPDY_KORE_FIN; - - net_send_queue(c, nb, length, NULL); + net_send_queue(c, nb, length, s); + } else { + net_send_queue(c, nb, length, NULL); + } } struct spdy_stream *