gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r23381 - libmicrohttpd/doc/examples


From: gnunet
Subject: [GNUnet-SVN] r23381 - libmicrohttpd/doc/examples
Date: Thu, 23 Aug 2012 14:36:18 +0200

Author: grothoff
Date: 2012-08-23 14:36:18 +0200 (Thu, 23 Aug 2012)
New Revision: 23381

Modified:
   libmicrohttpd/doc/examples/basicauthentication.c
   libmicrohttpd/doc/examples/hellobrowser.c
   libmicrohttpd/doc/examples/largepost.c
   libmicrohttpd/doc/examples/logging.c
   libmicrohttpd/doc/examples/responseheaders.c
   libmicrohttpd/doc/examples/sessions.c
   libmicrohttpd/doc/examples/simplepost.c
   libmicrohttpd/doc/examples/tlsauthentication.c
Log:
close file, clarify license

Modified: libmicrohttpd/doc/examples/basicauthentication.c
===================================================================
--- libmicrohttpd/doc/examples/basicauthentication.c    2012-08-23 12:28:46 UTC 
(rev 23380)
+++ libmicrohttpd/doc/examples/basicauthentication.c    2012-08-23 12:36:18 UTC 
(rev 23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>

Modified: libmicrohttpd/doc/examples/hellobrowser.c
===================================================================
--- libmicrohttpd/doc/examples/hellobrowser.c   2012-08-23 12:28:46 UTC (rev 
23380)
+++ libmicrohttpd/doc/examples/hellobrowser.c   2012-08-23 12:36:18 UTC (rev 
23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>

Modified: libmicrohttpd/doc/examples/largepost.c
===================================================================
--- libmicrohttpd/doc/examples/largepost.c      2012-08-23 12:28:46 UTC (rev 
23380)
+++ libmicrohttpd/doc/examples/largepost.c      2012-08-23 12:36:18 UTC (rev 
23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>
@@ -108,6 +111,7 @@
   return MHD_YES;
 }
 
+
 static void
 request_completed (void *cls, struct MHD_Connection *connection,
                    void **con_cls, enum MHD_RequestTerminationCode toe)
@@ -200,29 +204,32 @@
           return MHD_YES;
         }
       else
-        return send_page (connection, con_info->answerstring,
-                          con_info->answercode);
+       {
+         if (NULL != con_info->fp)
+           fclose (con_info->fp);
+         /* Now it is safe to open and inspect the file before calling 
send_page with a response */
+         return send_page (connection, con_info->answerstring,
+                           con_info->answercode);
+       }
+
     }
 
   return send_page (connection, errorpage, MHD_HTTP_BAD_REQUEST);
 }
 
+
 int
 main ()
 {
   struct MHD_Daemon *daemon;
 
-
   daemon = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY, PORT, NULL, NULL,
                              &answer_to_connection, NULL,
                              MHD_OPTION_NOTIFY_COMPLETED, request_completed,
                              NULL, MHD_OPTION_END);
   if (NULL == daemon)
     return 1;
-
   getchar ();
-
   MHD_stop_daemon (daemon);
-
   return 0;
 }

Modified: libmicrohttpd/doc/examples/logging.c
===================================================================
--- libmicrohttpd/doc/examples/logging.c        2012-08-23 12:28:46 UTC (rev 
23380)
+++ libmicrohttpd/doc/examples/logging.c        2012-08-23 12:36:18 UTC (rev 
23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>

Modified: libmicrohttpd/doc/examples/responseheaders.c
===================================================================
--- libmicrohttpd/doc/examples/responseheaders.c        2012-08-23 12:28:46 UTC 
(rev 23380)
+++ libmicrohttpd/doc/examples/responseheaders.c        2012-08-23 12:36:18 UTC 
(rev 23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>

Modified: libmicrohttpd/doc/examples/sessions.c
===================================================================
--- libmicrohttpd/doc/examples/sessions.c       2012-08-23 12:28:46 UTC (rev 
23380)
+++ libmicrohttpd/doc/examples/sessions.c       2012-08-23 12:36:18 UTC (rev 
23381)
@@ -1,27 +1,6 @@
-/*
-     This file is part of libmicrohttpd
-     (C) 2011 Christian Grothoff (and other contributing authors)
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
 
-     This library is free software; you can redistribute it and/or
-     modify it under the terms of the GNU Lesser General Public
-     License as published by the Free Software Foundation; either
-     version 2.1 of the License, or (at your option) any later version.
-
-     This library 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
-     Lesser General Public License for more details.
-
-     You should have received a copy of the GNU Lesser General Public
-     License along with this library; if not, write to the Free Software
-     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
 USA
-*/
-/**
- * @file post_example.c
- * @brief example for processing POST requests using libmicrohttpd
- * @author Christian Grothoff
- */
-
 /* needed for asprintf */
 #define _GNU_SOURCE
 

Modified: libmicrohttpd/doc/examples/simplepost.c
===================================================================
--- libmicrohttpd/doc/examples/simplepost.c     2012-08-23 12:28:46 UTC (rev 
23380)
+++ libmicrohttpd/doc/examples/simplepost.c     2012-08-23 12:36:18 UTC (rev 
23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>

Modified: libmicrohttpd/doc/examples/tlsauthentication.c
===================================================================
--- libmicrohttpd/doc/examples/tlsauthentication.c      2012-08-23 12:28:46 UTC 
(rev 23380)
+++ libmicrohttpd/doc/examples/tlsauthentication.c      2012-08-23 12:36:18 UTC 
(rev 23381)
@@ -1,3 +1,6 @@
+/* Feel free to use this example code in any way
+   you see fit (Public Domain) */
+
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/socket.h>




reply via email to

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