aboutsummaryrefslogtreecommitdiff
path: root/src/microspdy/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/microspdy/stream.h')
-rw-r--r--src/microspdy/stream.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/microspdy/stream.h b/src/microspdy/stream.h
new file mode 100644
index 00000000..a795ad28
--- /dev/null
+++ b/src/microspdy/stream.h
@@ -0,0 +1,65 @@
1/*
2 This file is part of libmicrospdy
3 Copyright (C) 2012 Andrey Uzunov
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/**
20 * @file stream.h
21 * @brief SPDY streams handling
22 * @author Andrey Uzunov
23 */
24
25#ifndef STREAM_H
26#define STREAM_H
27
28#include "platform.h"
29
30
31/**
32 * Reads data from session's read buffer and tries to create a new SPDY
33 * stream. This function is called after control frame's header has been
34 * read from the buffer (after the length field). If bogus frame is
35 * received the function changes the read handler of the session and
36 * fails, i.e. there is no need of further error handling by the caller.
37 *
38 * @param session SPDY_Session whose read buffer is being read
39 * @return SPDY_YES if a new SPDY stream request was correctly received
40 * and handled. SPDY_NO if the whole SPDY frame was not yet
41 * received or memory error occurred.
42 */
43int
44SPDYF_stream_new (struct SPDY_Session *session);
45
46
47/**
48 * Destroys stream structure and whatever is in it.
49 *
50 * @param stream SPDY_Stream to destroy
51 */
52void
53SPDYF_stream_destroy(struct SPDYF_Stream *stream);
54
55
56/**
57 * Set stream flags if needed based on the type of the frame that was
58 * just sent (e.g., close stream if it was RST_STREAM).
59 *
60 * @param response_queue sent for this stream
61 */
62void
63SPDYF_stream_set_flags(struct SPDYF_Response_Queue *response_queue);
64
65#endif