begin processing window_update messages

This commit is contained in:
Joris Vink 2013-05-02 10:10:03 +02:00
parent c2520b2ebf
commit f1fa108f98
3 changed files with 17 additions and 3 deletions

View File

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

View File

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

View File

@ -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;
@ -413,6 +417,18 @@ spdy_ctrl_frame_ping(struct netbuf *nb)
return (spdy_frame_send(c, SPDY_CTRL_FRAME_PING, 0, 4, id));
}
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)