Home | History | Annotate | Download | only in microspdy

Lines Matching full:session

20  * @file session.c
21 * @brief TCP connection/SPDY session handling. So far most of the
29 #include "session.h"
39 * of the session. New stream is created.
41 * @param session SPDY_Session whose read buffer is used.
44 spdyf_handler_read_syn_stream (struct SPDY_Session *session)
53 SPDYF_ASSERT(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status
54 || SPDY_SESSION_STATUS_WAIT_FOR_BODY == session->status,
57 frame = (struct SPDYF_Control_Frame *)session->frame_handler_cls;
60 if(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status)
67 //TODO maybe GOAWAY and closing session is appropriate
69 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
74 if(SPDY_YES != SPDYF_stream_new(session))
82 session->current_stream_id = session->streams_head->stream_id;
86 session->status = SPDY_SESSION_STATUS_IGNORE_BYTES;
90 session->status = SPDY_SESSION_STATUS_WAIT_FOR_BODY;
99 if(session->read_buffer_offset - session->read_buffer_beginning < compressed_data_size)
107 SPDYF_zlib_inflate(&session->zlib_recv_stream,
108 session->read_buffer + session->read_buffer_beginning,
116 * this session,
117 * so it is better to close the session */
121 /* mark the session for closing and close it, when
123 session->status = SPDY_SESSION_STATUS_FLUSHING;
125 SPDYF_prepare_goaway(session, SPDY_GOAWAY_STATUS_INTERNAL_ERROR, false);
133 if(SPDY_YES != SPDYF_prepare_rst_stream(session, session->streams_head,
151 session->streams_head->headers = headers;
153 if(SPDY_YES != session->daemon->fnew_stream_cb(session->daemon->fcls, session->streams_head))
160 session->read_buffer_beginning += compressed_data_size;
163 //SPDYF_DEBUG("syn_stream received: id %i", session->current_stream_id);
167 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
176 * of the session.
178 * @param session SPDY_Session whose read buffer is used.
181 spdyf_handler_read_goaway (struct SPDY_Session *session)
188 SPDYF_ASSERT(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status,
191 frame = (struct SPDYF_Control_Frame *)session->frame_handler_cls;
196 session->status = SPDY_SESSION_STATUS_IGNORE_BYTES;
207 if((session->read_buffer_offset - session->read_buffer_beginning) < frame->length)
214 //mark that the session is almost closed
215 session->is_goaway_received = true;
219 memcpy(&last_good_stream_id, session->read_buffer + session->read_buffer_beginning, 4);
221 session->read_buffer_beginning += 4;
223 memcpy(&status_int, session->read_buffer + session->read_buffer_beginning, 4);
225 session->read_buffer_beginning += 4;
246 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
254 * of the session is changed. Frames, belonging to this stream, which
257 * @param session SPDY_Session whose read buffer is used.
260 spdyf_handler_read_rst_stream (struct SPDY_Session *session)
268 SPDYF_ASSERT(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status,
271 frame = (struct SPDYF_Control_Frame *)session->frame_handler_cls;
278 session->status = SPDY_SESSION_STATUS_IGNORE_BYTES;
282 if((session->read_buffer_offset - session->read_buffer_beginning) < frame->length)
289 memcpy(&stream_id, session->read_buffer + session->read_buffer_beginning, 4);
291 session->read_buffer_beginning += 4;
293 memcpy(&status_int, session->read_buffer + session->read_buffer_beginning, 4);
295 session->read_buffer_beginning += 4;
297 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
301 stream = session->streams_head;
329 * @param session SPDY_Session whose read buffer is used.
332 spdyf_handler_read_data (struct SPDY_Session *session)
338 SPDYF_ASSERT(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status
339 || SPDY_SESSION_STATUS_WAIT_FOR_BODY == session->status,
346 frame = (struct SPDYF_Data_Frame *)session->frame_handler_cls;
349 if(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status)
353 session->status = SPDY_SESSION_STATUS_IGNORE_BYTES;
357 session->status = SPDY_SESSION_STATUS_WAIT_FOR_BODY;
362 if(session->read_buffer_offset - session->read_buffer_beginning
365 stream = SPDYF_stream_find(frame->stream_id, session);
367 if(NULL == stream || stream->is_in_closed || NULL == session->daemon->received_data_cb)
369 if(NULL == session->daemon->received_data_cb)
375 session->read_buffer_beginning += frame->length;
376 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
381 ret = session->daemon->freceived_data_cb(session->daemon->cls,
383 session->read_buffer + session->read_buffer_beginning,
387 session->read_buffer_beginning += frame->length;
405 if(SPDY_YES == SPDYF_prepare_window_update(session, stream,
415 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
422 SPDYF_handler_write_syn_reply (struct SPDY_Session *session)
424 struct SPDYF_Response_Queue *response_queue = session->response_queue_head;
433 SPDYF_ASSERT(NULL == session->write_buffer, "the function is called not in the correct moment");
437 if(SPDY_YES != SPDYF_zlib_deflate(&session->zlib_send_stream,
447 * this session,
448 * so it is better to close the session right now */
449 session->status = SPDY_SESSION_STATUS_CLOSING;
463 if(NULL == (session->write_buffer = malloc(total_size)))
468 * close the session */
469 session->status = SPDY_SESSION_STATUS_CLOSING;
475 session->write_buffer_beginning = 0;
476 session->write_buffer_offset = 0;
477 session->write_buffer_size = total_size;
483 memcpy(session->write_buffer + session->write_buffer_offset,&control_frame,sizeof(struct SPDYF_Control_Frame));
484 session->write_buffer_offset += sizeof(struct SPDYF_Control_Frame);
488 memcpy(session->write_buffer + session->write_buffer_offset, &stream_id_nbo, 4);
489 session->write_buffer_offset += 4;
492 memcpy(session->write_buffer + session->write_buffer_offset, compressed_headers, compressed_headers_size);
493 session->write_buffer_offset += compressed_headers_size;
495 SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
496 SPDYF_ASSERT(session->write_buffer_offset == session->write_buffer_size, "bug2");
499 /* SPDYF_zlib_deflate(&session->zlib_send_stream,
508 session->last_replied_to_stream_id = stream->stream_id;
517 SPDYF_handler_write_goaway (struct SPDY_Session *session)
519 struct SPDYF_Response_Queue *response_queue = session->response_queue_head;
524 SPDYF_ASSERT(NULL == session->write_buffer, "the function is called not in the correct moment");
528 session->is_goaway_sent = true;
534 if(NULL == (session->write_buffer = malloc(total_size)))
538 session->write_buffer_beginning = 0;
539 session->write_buffer_offset = 0;
540 session->write_buffer_size = total_size;
546 memcpy(session->write_buffer + session->write_buffer_offset,&control_frame,sizeof(struct SPDYF_Control_Frame));
547 session->write_buffer_offset += sizeof(struct SPDYF_Control_Frame);
550 last_good_stream_id = HTON31(session->last_replied_to_stream_id);
551 memcpy(session->write_buffer + session->write_buffer_offset, &last_good_stream_id, 4);
552 session->write_buffer_offset += 4;
555 memcpy(session->write_buffer + session->write_buffer_offset, response_queue->data, 4);
556 session->write_buffer_offset += 4;
562 SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
563 SPDYF_ASSERT(session->write_buffer_offset == session->write_buffer_size, "bug2");
570 SPDYF_handler_write_data (struct SPDY_Session *session)
572 struct SPDYF_Response_Queue *response_queue = session->response_queue_head;
579 SPDYF_ASSERT(NULL == session->write_buffer, "the function is called not in the correct moment");
591 if(NULL == (session->write_buffer = malloc(total_size)))
595 session->write_buffer_beginning = 0;
596 session->write_buffer_offset = 0;
597 session->write_buffer_size = total_size;
603 memcpy(session->write_buffer + session->write_buffer_offset,&data_frame,sizeof(struct SPDYF_Data_Frame));
604 session->write_buffer_offset += sizeof(struct SPDYF_Data_Frame);
607 memcpy(session->write_buffer + session->write_buffer_offset, response_queue->data, response_queue->data_size);
608 session->write_buffer_offset += response_queue->data_size;
619 if(NULL == (session->write_buffer = malloc(total_size)))
623 session->write_buffer_beginning = 0;
624 session->write_buffer_offset = 0;
625 session->write_buffer_size = total_size;
628 session->write_buffer + sizeof(struct SPDYF_Data_Frame),
634 free(session->write_buffer);
635 session->write_buffer = NULL;
638 if(SPDY_YES == (ret = SPDYF_prepare_rst_stream(session,
646 //for now close session
648 session->status = SPDY_SESSION_STATUS_CLOSING;
655 free(session->write_buffer);
656 session->write_buffer = NULL;
657 session->write_buffer_size = 0;
663 session->response_queue_head = response_queue->next;
664 session->response_queue_head->prev = NULL;
665 session->response_queue_tail->next = response_queue;
666 response_queue->prev = session->response_queue_tail;
668 session->response_queue_tail = response_queue;
689 //for now close session
690 session->status = SPDY_SESSION_STATUS_CLOSING;
692 free(session->write_buffer);
693 session->write_buffer = NULL;
702 session->response_queue_tail = new_response_queue;
724 memcpy(session->write_buffer + session->write_buffer_offset,
727 session->write_buffer_offset += sizeof(struct SPDYF_Data_Frame);
728 session->write_buffer_offset += ret;
729 session->write_buffer_size = session->write_buffer_offset;
734 SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
735 SPDYF_ASSERT(session->write_buffer_offset == session->write_buffer_size, "bug2");
742 SPDYF_handler_write_rst_stream (struct SPDY_Session *session)
744 struct SPDYF_Response_Queue *response_queue = session->response_queue_head;
748 SPDYF_ASSERT(NULL == session->write_buffer, "the function is called not in the correct moment");
756 if(NULL == (session->write_buffer = malloc(total_size)))
760 session->write_buffer_beginning = 0;
761 session->write_buffer_offset = 0;
762 session->write_buffer_size = total_size;
768 memcpy(session->write_buffer + session->write_buffer_offset,&control_frame,sizeof(struct SPDYF_Control_Frame));
769 session->write_buffer_offset += sizeof(struct SPDYF_Control_Frame);
772 memcpy(session->write_buffer + session->write_buffer_offset, response_queue->data, 8);
773 session->write_buffer_offset += 8;
779 SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
780 SPDYF_ASSERT(session->write_buffer_offset == session->write_buffer_size, "bug2");
787 SPDYF_handler_write_window_update (struct SPDY_Session *session)
789 struct SPDYF_Response_Queue *response_queue = session->response_queue_head;
793 SPDYF_ASSERT(NULL == session->write_buffer, "the function is called not in the correct moment");
801 if(NULL == (session->write_buffer = malloc(total_size)))
805 session->write_buffer_beginning = 0;
806 session->write_buffer_offset = 0;
807 session->write_buffer_size = total_size;
813 memcpy(session->write_buffer + session->write_buffer_offset,&control_frame,sizeof(struct SPDYF_Control_Frame));
814 session->write_buffer_offset += sizeof(struct SPDYF_Control_Frame);
817 memcpy(session->write_buffer + session->write_buffer_offset, response_queue->data, 8);
818 session->write_buffer_offset += 8;
822 SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
823 SPDYF_ASSERT(session->write_buffer_offset == session->write_buffer_size, "bug2");
830 SPDYF_handler_ignore_frame (struct SPDY_Session *session)
834 SPDYF_ASSERT(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status
835 || SPDY_SESSION_STATUS_WAIT_FOR_BODY == session->status,
839 frame = (struct SPDYF_Control_Frame *)session->frame_handler_cls;
842 if(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status)
846 session->status = SPDY_SESSION_STATUS_IGNORE_BYTES;
850 session->status = SPDY_SESSION_STATUS_WAIT_FOR_BODY;
855 if(session->read_buffer_offset - session->read_buffer_beginning
858 session->read_buffer_beginning += frame->length;
859 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
866 SPDYF_session_read (struct SPDY_Session *session)
872 if(SPDY_SESSION_STATUS_CLOSING == session->status
873 || SPDY_SESSION_STATUS_FLUSHING == session->status)
877 if (session->read_buffer_size == session->read_buffer_offset)
879 //but only if the state of the session requires it
882 actual_buf_size = session->read_buffer_offset
883 - session->read_buffer_beginning;
884 switch(session->status)
899 SPDYF_ASSERT(NULL != session->frame_handler_cls,
900 "no frame for session");
901 if(session->frame_handler != &spdyf_handler_read_data)
904 < ((struct SPDYF_Control_Frame *)session->frame_handler_cls)->length)
910 < ((struct SPDYF_Data_Frame *)session->frame_handler_cls)->length)
924 memmove(session->read_buffer,
925 session->read_buffer + session->read_buffer_beginning,
926 session->read_buffer_offset - session->read_buffer_beginning);
928 session->read_buffer_offset -= session->read_buffer_beginning;
929 session->read_buffer_beginning = 0;
939 session->last_activity = SPDYF_monotonic_time();
942 bytes_read = session->fio_recv(session,
943 session->read_buffer + session->read_buffer_offset,
944 session->read_buffer_size - session->read_buffer_offset);
951 shutdown (session->socket_fd, SHUT_RD);
952 session->read_closed = true;
953 session->status = SPDY_SESSION_STATUS_CLOSING;
959 SPDYF_prepare_goaway(session, SPDY_GOAWAY_STATUS_INTERNAL_ERROR, false);
961 session->status = SPDY_SESSION_STATUS_FLUSHING;
974 session->read_buffer_offset += bytes_read;
981 SPDYF_session_write (struct SPDY_Session *session,
989 if(SPDY_SESSION_STATUS_CLOSING == session->status)
992 if(SPDY_NO == session->fio_before_write(session))
998 : i < session->max_num_frames;
1003 if(NULL == session->write_buffer)
1006 response_queue = session->response_queue_head;
1018 DLL_remove(session->response_queue_head,session->response_queue_tail,response_queue);
1026 response_queue = session->response_queue_head;
1029 if(NULL == session->response_queue_head)
1034 if(SPDY_NO == session->response_queue_head->process_response_handler(session))
1037 //session's status appropriately
1038 if(SPDY_SESSION_STATUS_CLOSING == session->status)
1041 if(session->response_queue_head->is_data
1043 != session->response_queue_head->control_frame->type)
1045 session->status = SPDY_SESSION_STATUS_FLUSHING;
1046 SPDYF_prepare_goaway(session, SPDY_GOAWAY_STATUS_INTERNAL_ERROR, true);
1047 SPDYF_session_write(session,true);
1048 session->status = SPDY_SESSION_STATUS_CLOSING;
1061 if(0 == session->write_buffer_size)//nothing to write
1063 if(response_queue != session->response_queue_head)
1077 session->last_activity = SPDYF_monotonic_time();
1080 bytes_written = session->fio_send(session,
1081 session->write_buffer + session->write_buffer_beginning,
1082 session->write_buffer_offset - session->write_buffer_beginning);
1089 shutdown (session->socket_fd, SHUT_RD);
1090 session->read_closed = true;
1091 session->status = SPDY_SESSION_STATUS_CLOSING;
1097 session->status = SPDY_SESSION_STATUS_CLOSING;
1111 session->write_buffer_beginning += bytes_written;
1114 if(session->write_buffer_beginning == session->write_buffer_size)
1117 free(session->write_buffer);
1118 session->write_buffer = NULL;
1119 session->write_buffer_size = 0;
1120 queue_head = session->response_queue_head;
1123 session->response_queue_head = NULL;
1124 session->response_queue_tail = NULL;
1128 session->response_queue_head = queue_head->next;
1129 session->response_queue_head->prev = NULL;
1145 if(SPDY_SESSION_STATUS_FLUSHING == session->status
1146 && NULL == session->response_queue_head)
1147 session->status = SPDY_SESSION_STATUS_CLOSING;
1150 return session->fio_after_write(session, i>0 ? SPDY_YES : SPDY_NO);
1155 SPDYF_session_idle (struct SPDY_Session *session)
1162 //prepare session for closing if timeout is used and already passed
1163 if(SPDY_SESSION_STATUS_CLOSING != session->status
1164 && session->daemon->session_timeout
1165 && (session->last_activity + session->daemon->session_timeout < SPDYF_monotonic_time()))
1167 session->status = SPDY_SESSION_STATUS_CLOSING;
1169 SPDYF_prepare_goaway(session, SPDY_GOAWAY_STATUS_OK, true);
1170 SPDYF_session_write(session,true);
1173 switch(session->status)
1177 session->current_stream_id = 0;
1180 if(session->read_buffer_offset - session->read_buffer_beginning
1186 if(0x80 == *(uint8_t *)(session->read_buffer + session->read_buffer_beginning)
1187 && SPDY_VERSION == *((uint8_t *)session->read_buffer + session->read_buffer_beginning + 1))
1198 session->read_buffer + session->read_buffer_beginning,
1200 session->read_buffer_beginning += sizeof(struct SPDYF_Control_Frame);
1203 session->status = SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER;
1207 session->frame_handler = &spdyf_handler_read_syn_stream;
1210 session->frame_handler = &spdyf_handler_read_goaway;
1213 session->frame_handler = &spdyf_handler_read_rst_stream;
1216 session->frame_handler = &SPDYF_handler_ignore_frame;
1218 session->frame_handler_cls = control_frame;
1221 else if(0 == *(uint8_t *)(session->read_buffer + session->read_buffer_beginning))
1233 session->read_buffer + session->read_buffer_beginning,
1235 session->read_buffer_beginning += sizeof(struct SPDYF_Data_Frame);
1238 session->status = SPDY_SESSION_STATUS_WAIT_FOR_BODY;
1239 session->frame_handler = &spdyf_handler_read_data;
1240 session->frame_handler_cls = data_frame;
1249 * see any sense of keeping the session open since
1255 //shutdown(session->socket_fd, SHUT_RD);
1256 session->status = SPDY_SESSION_STATUS_FLUSHING;
1257 SPDYF_prepare_goaway(session, SPDY_GOAWAY_STATUS_PROTOCOL_ERROR,false);
1258 //SPDYF_session_write(session,false);
1261 //SPDYF_session_close(session);
1267 if(NULL!=session->frame_handler)
1269 read_buffer_beginning = session->read_buffer_beginning;
1272 session->frame_handler(session);
1274 if(SPDY_SESSION_STATUS_IGNORE_BYTES == session->status)
1277 if(session->frame_handler != &spdyf_handler_read_data)
1279 frame_length = ((struct SPDYF_Control_Frame *)session->frame_handler_cls)->length;
1283 frame_length = ((struct SPDYF_Data_Frame *)session->frame_handler_cls)->length;
1293 session->read_ignore_bytes = frame_length
1295 - session->read_buffer_offset;
1297 session->read_buffer_beginning = session->read_buffer_offset;
1299 SPDYF_prepare_rst_stream(session,
1300 session->current_stream_id > 0 ? session->streams_head : NULL, //may be 0 here which is not good
1305 session->status = session->read_ignore_bytes
1309 free(session->frame_handler_cls);
1314 if(SPDY_SESSION_STATUS_IGNORE_BYTES != session->status)
1321 SPDYF_ASSERT(session->read_ignore_bytes > 0,
1322 "Session is in wrong state");
1323 if(session->read_ignore_bytes
1324 > session->read_buffer_offset - session->read_buffer_beginning)
1326 session->read_ignore_bytes -=
1327 session->read_buffer_offset - session->read_buffer_beginning;
1328 session->read_buffer_beginning = session->read_buffer_offset;
1332 session->read_buffer_beginning += session->read_ignore_bytes;
1333 session->read_ignore_bytes = 0;
1334 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
1340 if(NULL!=session->frame_handler)
1341 session->frame_handler(session);
1348 //because of error the session needs to be closed
1351 SPDYF_session_close(session);
1360 SPDYF_session_close (struct SPDY_Session *session)
1362 struct SPDY_Daemon *daemon = session->daemon;
1363 int by_client = session->read_closed ? SPDY_YES : SPDY_NO;
1366 session->fio_close_session(session);
1367 shutdown (session->socket_fd,
1368 session->read_closed ? SHUT_WR : SHUT_RDWR);
1369 session->read_closed = true;
1371 //remove session from the list
1374 session);
1375 //add the session for the list for cleaning up
1378 session);
1380 //call callback for closed session
1383 daemon->session_closed_cb(daemon->cls, session, by_client);
1393 struct SPDY_Session *session = NULL;
1414 if (NULL == (session = malloc (sizeof (struct SPDY_Session))))
1418 memset (session, 0, sizeof (struct SPDY_Session));
1420 session->daemon = daemon;
1421 session->socket_fd = new_socket_fd;
1422 session->max_num_frames = daemon->max_num_frames;
1424 ret = SPDYF_io_set_session(session, daemon->io_subsystem);
1428 if(SPDY_YES != session->fio_new_session(session))
1434 session->read_buffer_size = SPDYF_BUFFER_SIZE;
1435 if (NULL == (session->read_buffer = malloc (session->read_buffer_size)))
1437 session->fio_close_session(session);
1442 if (NULL == (session->addr = malloc (addr_len)))
1444 session->fio_close_session(session);
1447 memcpy (session->addr, addr, addr_len);
1449 session->addr_len = addr_len;
1450 session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
1452 //init zlib context for the whole session
1453 if(SPDY_YES != SPDYF_zlib_deflate_init(&session->zlib_send_stream))
1455 session->fio_close_session(session);
1458 if(SPDY_YES != SPDYF_zlib_inflate_init(&session->zlib_recv_stream))
1460 session->fio_close_session(session);
1461 SPDYF_zlib_deflate_end(&session->zlib_send_stream);
1466 DLL_insert(daemon->sessions_head,daemon->sessions_tail,session);
1468 session->last_activity = SPDYF_monotonic_time();
1471 daemon->new_session_cb(daemon->cls, session);
1481 if(NULL != session)
1483 if(NULL != session->addr)
1484 free (session->addr);
1485 if(NULL != session->read_buffer)
1486 free (session->read_buffer);
1487 free (session);
1495 struct SPDY_Session *session,
1514 response_to_queue->prev = session->response_queue_tail;
1515 if (NULL == session->response_queue_head)
1516 session->response_queue_head = response_to_queue;
1518 session->response_queue_tail->next = response_to_queue;
1519 session->response_queue_tail = last;
1525 last->next = session->response_queue_head;
1526 if (NULL == session->response_queue_tail)
1527 session->response_queue_tail = last;
1529 session->response_queue_head->prev = response_to_queue;
1530 session->response_queue_head = response_to_queue;
1534 if(NULL == session->response_queue_tail)
1536 session->response_queue_head = response_to_queue;
1537 session->response_queue_tail = last;
1542 pos = session->response_queue_tail;
1553 session->response_queue_head->prev = last;
1554 last->next = session->response_queue_head;
1555 session->response_queue_head = response_to_queue;
1562 session->response_queue_tail = last;
1575 SPDYF_session_destroy(struct SPDY_Session *session)
1580 (void)close (session->socket_fd);
1581 SPDYF_zlib_deflate_end(&session->zlib_send_stream);
1582 SPDYF_zlib_inflate_end(&session->zlib_recv_stream);
1585 while (NULL != (response_queue = session->response_queue_head))
1587 DLL_remove (session->response_queue_head,
1588 session->response_queue_tail,
1599 //clean up the streams belonging to this session
1600 while (NULL != (stream = session->streams_head))
1602 DLL_remove (session->streams_head,
1603 session->streams_tail,
1609 free(session->addr);
1610 free(session->read_buffer);
1611 free(session->write_buffer);
1612 free(session);
1617 SPDYF_prepare_goaway (struct SPDY_Session *session,
1657 session,
1665 SPDYF_prepare_rst_stream (struct SPDY_Session *session,
1713 session,
1721 SPDYF_prepare_window_update (struct SPDY_Session *session,
1765 session,