gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r27771 - in libmicrohttpd: . src/include src/microspdy
Date: Fri, 5 Jul 2013 19:16:11 +0200

Author: andreyu
Date: 2013-07-05 19:16:11 +0200 (Fri, 05 Jul 2013)
New Revision: 27771

Modified:
   libmicrohttpd/README
   libmicrohttpd/src/include/microspdy.h
   libmicrohttpd/src/microspdy/daemon.c
   libmicrohttpd/src/microspdy/session.c
   libmicrohttpd/src/microspdy/structures.h
Log:
spdy: max num frames added as an option for the daemon

Modified: libmicrohttpd/README
===================================================================
--- libmicrohttpd/README        2013-07-05 16:54:29 UTC (rev 27770)
+++ libmicrohttpd/README        2013-07-05 17:16:11 UTC (rev 27771)
@@ -120,9 +120,6 @@
 Additional ideas for features include:
 - Individual callbacks for each session
 - Individual timeout for each session
-- Setting number of frames that can be written to the output at once. 
-  A big number means faster sending of a big resource, but the other 
-  sessions will wait longer.
 
 Unimplemented API functions of libmicrospdy:
 - SPDY_settings_create ();

Modified: libmicrohttpd/src/include/microspdy.h
===================================================================
--- libmicrohttpd/src/include/microspdy.h       2013-07-05 16:54:29 UTC (rev 
27770)
+++ libmicrohttpd/src/include/microspdy.h       2013-07-05 17:16:11 UTC (rev 
27771)
@@ -367,6 +367,18 @@
    * SPDY_IO_SUBSYSTEM value.
         */
        SPDY_DAEMON_OPTION_IO_SUBSYSTEM = 8,
+  
+       /**
+        * Maximum number of frames to be written to the socket at once. The
+   * library tries to send max_num_frames in a single call to SPDY_run
+   * for a single session. This means no requests can be received nor
+   * other sessions can send data as long the current one has enough
+   * frames to send and there is no error on writing. Thus, a big value
+   * will affect the performance. Small value gives fairnes for sessions.
+   * Must be followed by a positive integer (uin32_t). If not set, the
+   * default value 10 will be used.
+        */
+       SPDY_DAEMON_OPTION_MAX_NUM_FRAMES = 16,
 };
 
 

Modified: libmicrohttpd/src/microspdy/daemon.c
===================================================================
--- libmicrohttpd/src/microspdy/daemon.c        2013-07-05 16:54:29 UTC (rev 
27770)
+++ libmicrohttpd/src/microspdy/daemon.c        2013-07-05 17:16:11 UTC (rev 
27771)
@@ -145,6 +145,9 @@
                        case SPDY_DAEMON_OPTION_IO_SUBSYSTEM:
                                daemon->io_subsystem = va_arg (valist, enum 
SPDY_IO_SUBSYSTEM);
                                break;
+                       case SPDY_DAEMON_OPTION_MAX_NUM_FRAMES:
+                               daemon->max_num_frames = va_arg (valist, 
uint32_t);
+                               break;
                        default:
                                SPDYF_DEBUG("Wrong option for the daemon 
%i",opt);
                                return SPDY_NO;
@@ -200,6 +203,9 @@
                SPDYF_DEBUG("parse");
                goto free_and_fail;
        }
+  
+  if(0 == daemon->max_num_frames)
+    daemon->max_num_frames = SPDYF_NUM_SENT_FRAMES_AT_ONCE;
        
        if(!port && NULL == daemon->address)
        {

Modified: libmicrohttpd/src/microspdy/session.c
===================================================================
--- libmicrohttpd/src/microspdy/session.c       2013-07-05 16:54:29 UTC (rev 
27770)
+++ libmicrohttpd/src/microspdy/session.c       2013-07-05 17:16:11 UTC (rev 
27771)
@@ -861,7 +861,7 @@
 int
 SPDYF_session_write (struct SPDY_Session *session, bool only_one_frame)
 {
-       int i;
+       unsigned int i;
        int bytes_written;
        struct SPDYF_Response_Queue *queue_head;
        struct SPDYF_Response_Queue *response_queue;
@@ -872,7 +872,7 @@
        for(i=0;
                only_one_frame
                ? i < 1
-               : i < SPDYF_NUM_SENT_FRAMES_AT_ONCE;
+               : i < session->max_num_frames;
                ++i)
        {
                //if the buffer is not null, part of the last frame is still
@@ -1294,6 +1294,7 @@
        
        session->daemon = daemon;
        session->socket_fd = new_socket_fd;
+  session->max_num_frames = daemon->max_num_frames;
   
   ret = SPDYF_io_set_session(session, daemon->io_subsystem);
   SPDYF_ASSERT(SPDY_YES == ret, "Somehow daemon->io_subsystem iswrong here");

Modified: libmicrohttpd/src/microspdy/structures.h
===================================================================
--- libmicrohttpd/src/microspdy/structures.h    2013-07-05 16:54:29 UTC (rev 
27770)
+++ libmicrohttpd/src/microspdy/structures.h    2013-07-05 17:16:11 UTC (rev 
27771)
@@ -772,6 +772,15 @@
         * frame, e.g. larger than supported.
         */
        uint32_t current_stream_id;
+       
+       /**
+        * Maximum number of frames to be written to the socket at once. The
+   * library tries to send max_num_frames in a single call to SPDY_run
+   * for a single session. This means no requests can be received nor
+   * other sessions can send data as long the current one has enough
+   * frames to send and there is no error on writing.
+        */
+       uint32_t max_num_frames;
 
        /**
         * Shows the current receiving state the session, i.e. what is
@@ -908,6 +917,16 @@
         * Listen socket.
         */
        int socket_fd;
+       
+       /**
+   * This value is inherited by all sessions of the daemon.
+        * Maximum number of frames to be written to the socket at once. The
+   * library tries to send max_num_frames in a single call to SPDY_run
+   * for a single session. This means no requests can be received nor
+   * other sessions can send data as long the current one has enough
+   * frames to send and there is no error on writing.
+        */
+       uint32_t max_num_frames;
 
        /**
         * Daemon's options.




reply via email to

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