GNU libmicrohttpd  0.9.29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
io.c
Go to the documentation of this file.
1 /*
2  This file is part of libmicrospdy
3  Copyright (C) 2013 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 
25 #include "platform.h"
26 #include "structures.h"
27 #include "internal.h"
28 #include "io.h"
29 
30 
31 int
34 {
35  switch(io_subsystem)
36  {
38  daemon->fio_init = &SPDYF_openssl_init;
40  break;
41 
43  daemon->fio_init = &SPDYF_raw_init;
44  daemon->fio_deinit = &SPDYF_raw_deinit;
45  break;
46 
48  default:
49  SPDYF_DEBUG("Unsupported subsystem");
50  return SPDY_NO;
51  }
52 
53  return SPDY_YES;
54 }
55 
56 
57 int
60 {
61  switch(io_subsystem)
62  {
67  session->fio_recv = &SPDYF_openssl_recv;
68  session->fio_send = &SPDYF_openssl_send;
71  break;
72 
77  session->fio_recv = &SPDYF_raw_recv;
78  session->fio_send = &SPDYF_raw_send;
81  break;
82 
84  default:
85  SPDYF_DEBUG("Unsupported subsystem");
86  return SPDY_NO;
87  }
88 
89  return SPDY_YES;
90 }