commit f1fa108f98046c4a6d948145e22253f027d03240
parent c2520b2ebf7a861db6854267c307d2958a9135e7
Author: Joris Vink <joris@coders.se>
Date: Thu, 2 May 2013 10:10:03 +0200
begin processing window_update messages
Diffstat:
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/includes/spdy.h b/includes/spdy.h
@@ -69,6 +69,7 @@ extern const unsigned char SPDY_dictionary_txt[];
#define SPDY_CTRL_FRAME_SYN_REPLY 2
#define SPDY_CTRL_FRAME_SETTINGS 4
#define SPDY_CTRL_FRAME_PING 6
+#define SPDY_CTRL_FRAME_WINDOW 9
#define SPDY_DATA_FRAME 99
/* flags */
diff --git a/src/kore.c b/src/kore.c
@@ -104,7 +104,6 @@ main(int argc, char *argv[])
if (*fd == server.fd)
fatal("error on server socket");
- kore_log("client EPOLLERR | EPOLLHUP");
c = (struct connection *)events[i].data.ptr;
kore_server_disconnect(c);
continue;
@@ -246,7 +245,6 @@ kore_server_accept(struct listener *l)
TAILQ_INIT(&(c->recv_queue));
TAILQ_INIT(&(c->spdy_streams));;
kore_event(c->fd, EPOLLIN | EPOLLOUT | EPOLLET, c);
- kore_log("new connection from %s", inet_ntoa(c->sin.sin_addr));
return (KORE_RESULT_OK);
}
@@ -290,7 +288,6 @@ kore_server_final_disconnect(struct connection *c)
free(s);
}
- kore_log("disconnect connection from %s", inet_ntoa(c->sin.sin_addr));
free(c);
}
diff --git a/src/spdy.c b/src/spdy.c
@@ -40,6 +40,7 @@
static int spdy_ctrl_frame_syn_stream(struct netbuf *);
static int spdy_ctrl_frame_settings(struct netbuf *);
static int spdy_ctrl_frame_ping(struct netbuf *);
+static int spdy_ctrl_frame_window(struct netbuf *);
static int spdy_zlib_inflate(struct connection *, u_int8_t *,
size_t, u_int8_t **, u_int32_t *);
@@ -84,6 +85,9 @@ spdy_frame_recv(struct netbuf *nb)
case SPDY_CTRL_FRAME_PING:
cb = spdy_ctrl_frame_ping;
break;
+ case SPDY_CTRL_FRAME_WINDOW:
+ cb = spdy_ctrl_frame_window;
+ break;
default:
cb = NULL;
break;
@@ -414,6 +418,18 @@ spdy_ctrl_frame_ping(struct netbuf *nb)
}
static int
+spdy_ctrl_frame_window(struct netbuf *nb)
+{
+ u_int32_t stream_id, window_size;
+
+ stream_id = net_read32(nb->buf + SPDY_FRAME_SIZE);
+ window_size = net_read32(nb->buf + SPDY_FRAME_SIZE + 4);
+
+ kore_log("SPDY_WINDOW_UPDATE: %d:%d", stream_id, window_size);
+ return (KORE_RESULT_OK);
+}
+
+static int
spdy_zlib_inflate(struct connection *c, u_int8_t *src, size_t len,
u_int8_t **dst, u_int32_t *olen)
{