gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27768 - in libmicrohttpd/src: include microspdy


From: gnunet
Subject: [GNUnet-SVN] r27768 - in libmicrohttpd/src: include microspdy
Date: Fri, 5 Jul 2013 17:50:22 +0200

Author: andreyu
Date: 2013-07-05 17:50:21 +0200 (Fri, 05 Jul 2013)
New Revision: 27768

Added:
   libmicrohttpd/src/microspdy/io.c
Modified:
   libmicrohttpd/src/include/microspdy.h
   libmicrohttpd/src/microspdy/Makefile.am
   libmicrohttpd/src/microspdy/daemon.c
   libmicrohttpd/src/microspdy/io.h
   libmicrohttpd/src/microspdy/session.c
Log:
spdy: io_raw integrated; not yet settable

Modified: libmicrohttpd/src/include/microspdy.h
===================================================================
--- libmicrohttpd/src/include/microspdy.h       2013-07-05 15:34:19 UTC (rev 
27767)
+++ libmicrohttpd/src/include/microspdy.h       2013-07-05 15:50:21 UTC (rev 
27768)
@@ -319,7 +319,7 @@
        /**
         * No TLS is used.
         */
-       SPDY_IO_SUBSYSTEM_RAW = 0,
+       SPDY_IO_SUBSYSTEM_RAW = 2,
 };
 
 

Modified: libmicrohttpd/src/microspdy/Makefile.am
===================================================================
--- libmicrohttpd/src/microspdy/Makefile.am     2013-07-05 15:34:19 UTC (rev 
27767)
+++ libmicrohttpd/src/microspdy/Makefile.am     2013-07-05 15:50:21 UTC (rev 
27768)
@@ -15,7 +15,7 @@
   libmicrospdy.la
 
 libmicrospdy_la_SOURCES = \
-  io.h \
+  io.h io.c \
   io_openssl.h io_openssl.c \
   io_raw.h io_raw.c \
   structures.h structures.c \

Modified: libmicrohttpd/src/microspdy/daemon.c
===================================================================
--- libmicrohttpd/src/microspdy/daemon.c        2013-07-05 15:34:19 UTC (rev 
27767)
+++ libmicrohttpd/src/microspdy/daemon.c        2013-07-05 15:50:21 UTC (rev 
27768)
@@ -191,8 +191,8 @@
        memset (daemon, 0, sizeof (struct SPDY_Daemon));
        daemon->socket_fd = -1;
        daemon->port = port;
-  daemon->fio_init = &SPDYF_openssl_init;
-  daemon->fio_deinit = &SPDYF_openssl_deinit;
+  SPDYF_io_set_daemon(daemon, SPDY_IO_SUBSYSTEM_OPENSSL);
+  
        if (NULL == (daemon->certfile = strdup (certfile)))
        {
                SPDYF_DEBUG("str");

Added: libmicrohttpd/src/microspdy/io.c
===================================================================
--- libmicrohttpd/src/microspdy/io.c                            (rev 0)
+++ libmicrohttpd/src/microspdy/io.c    2013-07-05 15:50:21 UTC (rev 27768)
@@ -0,0 +1,84 @@
+/*
+    This file is part of libmicrospdy
+    Copyright (C) 2013 Andrey Uzunov
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file io.c
+ * @brief  Functions for IO.
+ * @author Andrey Uzunov
+ */
+
+#include "platform.h"
+#include "structures.h"
+#include "internal.h"
+#include "io.h"
+
+
+int
+SPDYF_io_set_daemon(struct SPDY_Daemon *daemon, enum SPDY_IO_SUBSYSTEM 
io_subsystem)
+{
+  switch(io_subsystem)
+  {
+    case SPDY_IO_SUBSYSTEM_OPENSSL:
+      daemon->fio_init = &SPDYF_openssl_init;
+      daemon->fio_deinit = &SPDYF_openssl_deinit;
+      break;
+      
+    case SPDY_IO_SUBSYSTEM_RAW:
+      daemon->fio_init = &SPDYF_raw_init;
+      daemon->fio_deinit = &SPDYF_raw_deinit;
+      break;
+      
+    case SPDY_IO_SUBSYSTEM_NONE:
+    default:
+      SPDYF_DEBUG("Unsupported subsystem");
+      return SPDY_NO;
+  }
+  
+  return SPDY_YES;
+}
+
+
+int
+SPDYF_io_set_session(struct SPDY_Session *session, enum SPDY_IO_SUBSYSTEM 
io_subsystem)
+{
+  switch(io_subsystem)
+  {
+    case SPDY_IO_SUBSYSTEM_OPENSSL:
+      session->fio_new_session = &SPDYF_openssl_new_session;
+      session->fio_close_session = &SPDYF_openssl_close_session;
+      session->fio_is_pending = &SPDYF_openssl_is_pending;
+      session->fio_recv = &SPDYF_openssl_recv;
+      session->fio_send = &SPDYF_openssl_send;
+      break;
+      
+    case SPDY_IO_SUBSYSTEM_RAW:
+      session->fio_new_session = &SPDYF_raw_new_session;
+      session->fio_close_session = &SPDYF_raw_close_session;
+      session->fio_is_pending = &SPDYF_raw_is_pending;
+      session->fio_recv = &SPDYF_raw_recv;
+      session->fio_send = &SPDYF_raw_send;
+      break;
+      
+    case SPDY_IO_SUBSYSTEM_NONE:
+    default:
+      SPDYF_DEBUG("Unsupported subsystem");
+      return SPDY_NO;
+  }
+  
+  return SPDY_YES;
+}

Modified: libmicrohttpd/src/microspdy/io.h
===================================================================
--- libmicrohttpd/src/microspdy/io.h    2013-07-05 15:34:19 UTC (rev 27767)
+++ libmicrohttpd/src/microspdy/io.h    2013-07-05 15:50:21 UTC (rev 27768)
@@ -161,4 +161,24 @@
 typedef int
 (*SPDYF_IOIsPending) (struct SPDY_Session *session);
 
+
+/**
+ * Sets callbacks for the daemon with regard to the IO subsystem.
+ *
+ * @param daemon
+ * @return SPDY_YES on success or SPDY_NO otherwise
+ */
+int
+SPDYF_io_set_daemon(struct SPDY_Daemon *daemon, enum SPDY_IO_SUBSYSTEM 
io_subsystem);
+
+
+/**
+ * Sets callbacks for the session with regard to the IO subsystem.
+ *
+ * @param session
+ * @return SPDY_YES on success or SPDY_NO otherwise
+ */
+int
+SPDYF_io_set_session(struct SPDY_Session *session, enum SPDY_IO_SUBSYSTEM 
io_subsystem);
+
 #endif

Modified: libmicrohttpd/src/microspdy/session.c
===================================================================
--- libmicrohttpd/src/microspdy/session.c       2013-07-05 15:34:19 UTC (rev 
27767)
+++ libmicrohttpd/src/microspdy/session.c       2013-07-05 15:50:21 UTC (rev 
27768)
@@ -1305,12 +1305,8 @@
        
        session->daemon = daemon;
        session->socket_fd = new_socket_fd;
-    
-  session->fio_new_session = &SPDYF_openssl_new_session;
-  session->fio_close_session = &SPDYF_openssl_close_session;
-  session->fio_is_pending = &SPDYF_openssl_is_pending;
-  session->fio_recv = &SPDYF_openssl_recv;
-  session->fio_send = &SPDYF_openssl_send;
+  
+  SPDYF_io_set_session(session, SPDY_IO_SUBSYSTEM_OPENSSL);
        
        //init TLS context, handshake will be done
        if(SPDY_YES != session->fio_new_session(session))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]