gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r29103 - in libmicrohttpd/src: include microspdy
Date: Sun, 8 Sep 2013 12:37:24 +0200

Author: andreyu
Date: 2013-09-08 12:37:24 +0200 (Sun, 08 Sep 2013)
New Revision: 29103

Modified:
   libmicrohttpd/src/include/microspdy.h
   libmicrohttpd/src/microspdy/daemon.h
   libmicrohttpd/src/microspdy/internal.h
   libmicrohttpd/src/microspdy/io.c
   libmicrohttpd/src/microspdy/io.h
   libmicrohttpd/src/microspdy/session.c
   libmicrohttpd/src/microspdy/session.h
Log:
spdy: doc -- parameter description fixed

Modified: libmicrohttpd/src/include/microspdy.h
===================================================================
--- libmicrohttpd/src/include/microspdy.h       2013-09-08 10:34:08 UTC (rev 
29102)
+++ libmicrohttpd/src/include/microspdy.h       2013-09-08 10:37:24 UTC (rev 
29103)
@@ -807,7 +807,7 @@
  * and possibly other stuff needed by the lib. Currently the call
  * always returns SPDY_YES.
  * 
- * @param enum SPDY_IO_SUBSYSTEM io_subsystem the IO subsystem that will
+ * @param io_subsystem the IO subsystem that will
  *        be initialized. Several can be used with bitwise OR. If no
  *        parameter is set, the default openssl subsystem will be used.
  * @return SPDY_YES if the library was correctly initialized and its

Modified: libmicrohttpd/src/microspdy/daemon.h
===================================================================
--- libmicrohttpd/src/microspdy/daemon.h        2013-09-08 10:34:08 UTC (rev 
29102)
+++ libmicrohttpd/src/microspdy/daemon.h        2013-09-08 10:37:24 UTC (rev 
29103)
@@ -47,6 +47,8 @@
  * @param npdcb callback called when HTTP POST params are received
  *                     after request
  * @param fnscb callback called when new stream is opened by a client
+ * @param fndcb callback called when new data -- within a data frame --
+ *        is received by the server
  * @param cls extra argument to all of the callbacks without those
  *                              specific only for the framing layer
  * @param fcls extra argument to all of the callbacks, specific only for

Modified: libmicrohttpd/src/microspdy/internal.h
===================================================================
--- libmicrohttpd/src/microspdy/internal.h      2013-09-08 10:34:08 UTC (rev 
29102)
+++ libmicrohttpd/src/microspdy/internal.h      2013-09-08 10:37:24 UTC (rev 
29103)
@@ -73,10 +73,10 @@
 /**
  * Asserts the validity of an expression.
  *
- * @param expression (bool)
+ * @param expr (bool)
  * @param msg message to print on error (const char *)
  */
-#define SPDYF_ASSERT(expr,msg) \
+#define SPDYF_ASSERT(expr, msg) \
        if(!(expr)){\
                SPDYF_PANIC(msg);\
                abort();\

Modified: libmicrohttpd/src/microspdy/io.c
===================================================================
--- libmicrohttpd/src/microspdy/io.c    2013-09-08 10:34:08 UTC (rev 29102)
+++ libmicrohttpd/src/microspdy/io.c    2013-09-08 10:37:24 UTC (rev 29103)
@@ -18,7 +18,7 @@
 
 /**
  * @file io.c
- * @brief  Functions for IO.
+ * @brief Generic functions for IO.
  * @author Andrey Uzunov
  */
 
@@ -29,7 +29,8 @@
 
 
 int
-SPDYF_io_set_daemon(struct SPDY_Daemon *daemon, enum SPDY_IO_SUBSYSTEM 
io_subsystem)
+SPDYF_io_set_daemon(struct SPDY_Daemon *daemon,
+                    enum SPDY_IO_SUBSYSTEM io_subsystem)
 {
   switch(io_subsystem)
   {
@@ -54,7 +55,8 @@
 
 
 int
-SPDYF_io_set_session(struct SPDY_Session *session, enum SPDY_IO_SUBSYSTEM 
io_subsystem)
+SPDYF_io_set_session(struct SPDY_Session *session,
+                     enum SPDY_IO_SUBSYSTEM io_subsystem)
 {
   switch(io_subsystem)
   {

Modified: libmicrohttpd/src/microspdy/io.h
===================================================================
--- libmicrohttpd/src/microspdy/io.h    2013-09-08 10:34:08 UTC (rev 29102)
+++ libmicrohttpd/src/microspdy/io.h    2013-09-08 10:37:24 UTC (rev 29103)
@@ -184,26 +184,33 @@
  * @return returned value will be used by the write function to return
  */
 typedef int
-(*SPDYF_IOAfterWrite) (struct SPDY_Session *session, int was_written);
+(*SPDYF_IOAfterWrite) (struct SPDY_Session *session,
+                       int was_written);
 
 
 /**
  * Sets callbacks for the daemon with regard to the IO subsystem.
  *
  * @param daemon
+ * @param io_subsystem the IO subsystem that will
+ *        be initialized and used by 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);
+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
+ * @param io_subsystem the IO subsystem that will
+ *        be initialized and used by 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);
+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-09-08 10:34:08 UTC (rev 
29102)
+++ libmicrohttpd/src/microspdy/session.c       2013-09-08 10:37:24 UTC (rev 
29103)
@@ -159,6 +159,8 @@
     free(name_value_strm);
   }
   
+  //SPDYF_DEBUG("syn_stream received: id %i", session->current_stream_id);
+  
        //change state to wait for new frame
        session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
        free(frame);
@@ -235,6 +237,8 @@
                        case SPDY_GOAWAY_STATUS_INTERNAL_ERROR:
                                break;
                }
+  
+    //SPDYF_DEBUG("goaway received: status %i", status);
        }
        
        session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
@@ -256,7 +260,7 @@
        struct SPDYF_Control_Frame *frame;
        uint32_t stream_id;
        int32_t status_int;
-       enum SPDY_RST_STREAM_STATUS status;
+       //enum SPDY_RST_STREAM_STATUS status; //for debug
        struct SPDYF_Stream *stream;
        
        SPDYF_ASSERT(SPDY_SESSION_STATUS_WAIT_FOR_SUBHEADER == session->status,
@@ -285,7 +289,7 @@
        session->read_buffer_beginning += 4;
        
     memcpy(&status_int, session->read_buffer + session->read_buffer_beginning, 
4);
-       status = ntohl(status_int);
+       //status = ntohl(status_int); //for debug
        session->read_buffer_beginning += 4;
        
        session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
@@ -304,7 +308,7 @@
                stream = stream->next;
        }
        
-       SPDYF_DEBUG("Received RST_STREAM; status=%i; id=%i",status,stream_id);
+       //SPDYF_DEBUG("Received RST_STREAM; status=%i; id=%i",status,stream_id);
        
        //do something according to the status
        //TODO
@@ -361,10 +365,8 @@
     if(NULL == stream || stream->is_in_closed || NULL == 
session->daemon->received_data_cb)
     {
       if(NULL == session->daemon->received_data_cb)
-      SPDYF_DEBUG("No callback for DATA frame set");
+      SPDYF_DEBUG("No callback for DATA frame set; Ignoring DATA frame!");
       
-      SPDYF_DEBUG("Ignoring DATA frame!");
-      
       //TODO send error?
       
       //TODO for now ignore frame
@@ -405,6 +407,9 @@
       }
       //else: do it later
     }
+  
+    //SPDYF_DEBUG("data received: id %i", frame->stream_id);
+  
     session->status = SPDY_SESSION_STATUS_WAIT_FOR_HEADER;
     free(frame);
        }
@@ -499,6 +504,8 @@
        free(compressed_headers);
        
        session->last_replied_to_stream_id = stream->stream_id;
+       
+  //SPDYF_DEBUG("syn_reply sent: id %i", stream->stream_id);
 
        return SPDY_YES;
 }
@@ -548,6 +555,8 @@
        //data is not freed by the destroy function so:
        //free(response_queue->data);
        
+  //SPDYF_DEBUG("goaway sent: status %i", 
NTOH31(*(uint32_t*)(response_queue->data)));
+  
        SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
        SPDYF_ASSERT(session->write_buffer_offset == 
session->write_buffer_size, "bug2");
 
@@ -717,6 +726,8 @@
                session->write_buffer_offset +=  ret;
                session->write_buffer_size = session->write_buffer_offset;
        }
+  
+  //SPDYF_DEBUG("data sent: id %i", NTOH31(data_frame.stream_id));
 
        SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
        SPDYF_ASSERT(session->write_buffer_offset == 
session->write_buffer_size, "bug2");
@@ -761,6 +772,8 @@
        //data is not freed by the destroy function so:
        //free(response_queue->data);
        
+  //SPDYF_DEBUG("rst_stream sent: id %i", 
NTOH31((((uint64_t)response_queue->data) & 0xFFFF0000) >> 32));
+  
        SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
        SPDYF_ASSERT(session->write_buffer_offset == 
session->write_buffer_size, "bug2");
 
@@ -802,6 +815,8 @@
        memcpy(session->write_buffer + session->write_buffer_offset, 
response_queue->data, 8);
        session->write_buffer_offset +=  8;
        
+  //SPDYF_DEBUG("window_update sent: id %i", 
NTOH31((((uint64_t)response_queue->data) & 0xFFFF0000) >> 32));
+       
        SPDYF_ASSERT(0 == session->write_buffer_beginning, "bug1");
        SPDYF_ASSERT(session->write_buffer_offset == 
session->write_buffer_size, "bug2");
 
@@ -961,7 +976,8 @@
 
 
 int
-SPDYF_session_write (struct SPDY_Session *session, bool only_one_frame)
+SPDYF_session_write (struct SPDY_Session *session,
+                     bool only_one_frame)
 {
        unsigned int i;
        int bytes_written;
@@ -1033,6 +1049,7 @@
                                }
                                
                                //just return from the loop to return from this 
function
+        ++i;
                                break;
                        }
                        
@@ -1049,6 +1066,7 @@
                                else
                                {
                                        //no need to try the same frame again
+          ++i;
                                        break;
                                }
       }

Modified: libmicrohttpd/src/microspdy/session.h
===================================================================
--- libmicrohttpd/src/microspdy/session.h       2013-09-08 10:34:08 UTC (rev 
29102)
+++ libmicrohttpd/src/microspdy/session.h       2013-09-08 10:37:24 UTC (rev 
29103)
@@ -51,20 +51,22 @@
  * queue, and to write data to the TLS socket. 
  *
  * @param session SPDY_Session for which data will be written.
- * @return  TODO document after changes
- * SPDY_YES if something was written, the status was changed or
- * response callback was called but did not provide data
- * @return SPDY_YES if something was written, session's status was
- *         changed or response callback was called but did not provide
+ * @param only_one_frame when true, the function will write at most one
+ *        SPDY frame to the underlying IO subsystem;
+ *        when false, the function will write up to
+ *        session->max_num_frames SPDY frames
+ * @return SPDY_YES if the session's internal writing state has changed:
+ *         something was written and/or session's status was
+ *         changed and/or response callback was called but did not provide
  *         data. It is possible that error occurred but was handled
  *         and the status was therefore changed.
- *         SPDY_NO if nothing happened, e.g. the subsystem wants read/
- *         write to be called again. However, it is possible that some
+ *         SPDY_NO if nothing happened. However, it is possible that some
  *         frames were discarded within the call, e.g. frames belonging
  *         to a closed stream.
  */
 int
-SPDYF_session_write (struct SPDY_Session *session, bool only_one_frame);
+SPDYF_session_write (struct SPDY_Session *session,
+                     bool only_one_frame);
 
 
 /**




reply via email to

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