gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r22202 - gnunet-gtk/src/setup libmicrohttpd/doc/chapters li


From: gnunet
Subject: [GNUnet-SVN] r22202 - gnunet-gtk/src/setup libmicrohttpd/doc/chapters libmicrohttpd/doc/examples libmicrohttpd-docs/WWW
Date: Fri, 22 Jun 2012 11:08:03 +0200

Author: grothoff
Date: 2012-06-22 11:08:03 +0200 (Fri, 22 Jun 2012)
New Revision: 22202

Modified:
   gnunet-gtk/src/setup/gnunet-setup-options.c
   libmicrohttpd-docs/WWW/tutorial.html
   libmicrohttpd-docs/WWW/tutorial.pdf
   libmicrohttpd/doc/chapters/tlsauthentication.inc
   libmicrohttpd/doc/examples/tlsauthentication.c
Log:
-fixing #2443: tutorial was unclear

Modified: gnunet-gtk/src/setup/gnunet-setup-options.c
===================================================================
--- gnunet-gtk/src/setup/gnunet-setup-options.c 2012-06-22 08:46:52 UTC (rev 
22201)
+++ gnunet-gtk/src/setup/gnunet-setup-options.c 2012-06-22 09:08:03 UTC (rev 
22202)
@@ -1039,7 +1039,7 @@
   GtkTreeIter iter;
   gchar *old;
 
-  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
+  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("GNUNET_setup_gns_liststore"));
   if (NULL == tm)
   {
     GNUNET_break (0);
@@ -1140,7 +1140,7 @@
     /* FIXME: warn... */
     return;
   }
-  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
+  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("GNUNET_setup_gns_liststore"));
   if (NULL == tm)
   {
     GNUNET_break (0);
@@ -1224,7 +1224,7 @@
     /* invalid port, FIXME: warn */
     return;
   }
-  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
+  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("GNUNET_setup_gns_liststore"));
   if (NULL == tm)
   {
     GNUNET_break (0);
@@ -1304,7 +1304,7 @@
   GtkListStore *ls;
   GtkTreeIter iter;
 
-  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("vpn_dns_config_liststore"));
+  tm = GTK_TREE_MODEL (GNUNET_SETUP_get_object ("GNUNET_setup_gns_liststore"));
   if (NULL == tm)
   {
     GNUNET_break (0);

Modified: libmicrohttpd/doc/chapters/tlsauthentication.inc
===================================================================
--- libmicrohttpd/doc/chapters/tlsauthentication.inc    2012-06-22 08:46:52 UTC 
(rev 22201)
+++ libmicrohttpd/doc/chapters/tlsauthentication.inc    2012-06-22 09:08:03 UTC 
(rev 22202)
@@ -157,8 +157,11 @@
 #include <gnutls/x509.h>
 
 gnutls_session_t tls_session;
-tls_session = MHD_get_connection_info (connection, 
-                                       MHD_CONNECTION_INFO_GNUTLS_SESSION);
+union MHD_ConnectionInfo *ci;
+
+ci = MHD_get_connection_info (connection, 
+                              MHD_CONNECTION_INFO_GNUTLS_SESSION);
+tls_session = ci->tls_session;
 @end verbatim
 
 You can then extract the client certificate:

Modified: libmicrohttpd/doc/examples/tlsauthentication.c
===================================================================
--- libmicrohttpd/doc/examples/tlsauthentication.c      2012-06-22 08:46:52 UTC 
(rev 22201)
+++ libmicrohttpd/doc/examples/tlsauthentication.c      2012-06-22 09:08:03 UTC 
(rev 22202)
@@ -13,7 +13,7 @@
 #define SERVERCERTFILE "server.pem"
 
 
-char *
+static char *
 string_to_base64 (const char *message)
 {
   const char *lookup =

Modified: libmicrohttpd-docs/WWW/tutorial.html
===================================================================
--- libmicrohttpd-docs/WWW/tutorial.html        2012-06-22 08:46:52 UTC (rev 
22201)
+++ libmicrohttpd-docs/WWW/tutorial.html        2012-06-22 09:08:03 UTC (rev 
22202)
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html401/loose.dtd";>
 <html>
-<!-- This tutorial documents GNU libmicrohttpd version 0.9.8, last
-updated 28 Feb 2010. 
+<!-- This tutorial documents GNU libmicrohttpd version 0.9.16, last
+updated 2 Nov 2011. 
 
 Copyright (c)  2008  Sebastian Gerhardt.
 
@@ -14,7 +14,7 @@
 Free Documentation License".
 
  -->
-<!-- Created on March 4, 2011 by texi2html 1.82
+<!-- Created on June 22, 2012 by texi2html 1.82
 texi2html was written by: 
             Lionel Cons <address@hidden> (original author)
             Karl Berry  <address@hidden>
@@ -125,7 +125,7 @@
 encouraged to study the relevant <em>RFCs</em>, which document the HTTP 
standard.
 </p>
 <p><em>GNU libmicrohttpd</em> is assumed to be already installed.  This 
tutorial
-is written for version 0.9.8.  At the time being, 
+is written for version 0.9.16.  At the time being, 
 this tutorial has only been tested on <em>GNU/Linux</em> machines even though
 efforts were made not to rely on anything that would prevent the samples from 
being
 built on similar systems.
@@ -291,7 +291,7 @@
 </p>
 <p>Compile it with 
 </p><pre class="verbatim">cc hellobrowser.c -o hellobrowser 
-I$PATH_TO_LIBMHD_INCLUDES 
-  -L$PATH_TO_LIBMHD_INCLUDES -lmicrohttpd
+  -L$PATH_TO_LIBMHD_LIBS -lmicrohttpd
 </pre><p>with the two paths set accordingly and run it.
 </p>
 <p>Now open your favorite Internet browser and go to the address 
<code>http://localhost:8888/</code>, provided that 8888
@@ -311,12 +311,17 @@
 <code>MHD_NO</code> if not so.
 </p>
 <p>Secondly, the above practice of queuing a response upon the first call of 
the callback function
-brings with it some limitations. This is because the content of the message 
body will not be
-received if a response is queued in the first iteration. Furthermore, the 
connection will be closed
-right after the response has been transferred then.
+brings with it some limitations.  This is because the content of the message 
body will not be
+received if a response is queued in the first iteration.  Furthermore, the 
connection will be closed
+right after the response has been transferred then.  This is typically not 
what you want as it
+disables HTTP pipelining.  The correct approach is to simply not queue a 
message on the first
+callback unless there is an error.  The <code>void**</code> argument to the 
callback provides a location
+for storing information about the history of the connection; for the first 
call, the pointer
+will point to NULL.  A simplistic way to differenciate the first call from 
others is to check
+if the pointer is NULL and set it to a non-NULL value during the first call.
 </p>
 <p>Both of these issues you will find addressed in the official 
<code>minimal_example.c</code> residing in
-the <code>src/examples</code> directory of the <em>MHD</em> package. The 
source code of this
+the <code>src/examples</code> directory of the <em>MHD</em> package.  The 
source code of this
 program should look very familiar to you by now and easy to understand.
 </p>
 <p>For our example, the <code>must_copy</code> and <code>must_free</code> 
parameter at the response construction
@@ -622,7 +627,7 @@
 <p>Up to this point, there was little new. The actual novelty is that we 
enhance the header with the
 meta data about the content. Aware of the field&rsquo;s name we want to add, 
it is as easy as that:
 </p><pre class="verbatim">MHD_add_response_header(response, 
&quot;Content-Type&quot;, MIMETYPE);
-</pre><p>We do not have to append a colon expected by the protocol hehind the 
first 
+</pre><p>We do not have to append a colon expected by the protocol behind the 
first 
 field&mdash;<em>GNU libhttpdmicro</em> will take care of this. 
 </p>
 <p>The function finishes with the well-known lines
@@ -1631,8 +1636,11 @@
 #include &lt;gnutls/x509.h&gt;
 
 gnutls_session_t tls_session;
-tls_session = MHD_get_connection_info (connection, 
-                                       MHD_CONNECTION_INFO_GNUTLS_SESSION);
+union MHD_ConnectionInfo *ci;
+
+ci = MHD_get_connection_info (connection, 
+                              MHD_CONNECTION_INFO_GNUTLS_SESSION);
+tls_session = ci-&gt;tls_session;
 </pre>
 <p>You can then extract the client certificate:
 </p>
@@ -2421,7 +2429,7 @@
   const char *page = &quot;&lt;html&gt;&lt;body&gt;Hello, 
browser!&lt;/body&gt;&lt;/html&gt;&quot;;
   struct MHD_Response *response;
   int ret;
-
+  
   response =
     MHD_create_response_from_buffer (strlen (page), (void *) page, 
                                     MHD_RESPMEM_PERSISTENT);
@@ -3970,7 +3978,7 @@
 #define SERVERCERTFILE &quot;server.pem&quot;
 
 
-char *
+static char *
 string_to_base64 (const char *message)
 {
   const char *lookup =
@@ -4268,7 +4276,7 @@
 </tr></table>
 <h1>About This Document</h1>
 <p>
-  This document was generated by <em>Christian Grothoff</em> on <em>March 4, 
2011</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated by <em>Christian Grothoff</em> on <em>June 22, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
 </p>
 <p>
   The buttons in the navigation panels have the following meaning:
@@ -4370,7 +4378,7 @@
 <hr size="1">
 <p>
  <font size="-1">
-  This document was generated by <em>Christian Grothoff</em> on <em>March 4, 
2011</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
+  This document was generated by <em>Christian Grothoff</em> on <em>June 22, 
2012</em> using <a href="http://www.nongnu.org/texi2html/";><em>texi2html 
1.82</em></a>.
  </font>
  <br>
 

Modified: libmicrohttpd-docs/WWW/tutorial.pdf
===================================================================
(Binary files differ)




reply via email to

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