gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5030 - libmicrohttpd/src/daemon


From: gnunet
Subject: [GNUnet-SVN] r5030 - libmicrohttpd/src/daemon
Date: Wed, 13 Jun 2007 01:03:24 -0600 (MDT)

Author: grothoff
Date: 2007-06-13 01:03:22 -0600 (Wed, 13 Jun 2007)
New Revision: 5030

Added:
   libmicrohttpd/src/daemon/internal.c
Modified:
   libmicrohttpd/src/daemon/Makefile.am
   libmicrohttpd/src/daemon/daemon.c
   libmicrohttpd/src/daemon/internal.h
   libmicrohttpd/src/daemon/response.c
   libmicrohttpd/src/daemon/session.c
Log:
cleanup

Modified: libmicrohttpd/src/daemon/Makefile.am
===================================================================
--- libmicrohttpd/src/daemon/Makefile.am        2007-06-13 07:00:59 UTC (rev 
5029)
+++ libmicrohttpd/src/daemon/Makefile.am        2007-06-13 07:03:22 UTC (rev 
5030)
@@ -11,7 +11,7 @@
 #  -lm
 libmicrohttpd_la_SOURCES = \
   daemon.c  \
-  internal.h \
+  internal.c internal.h \
   response.c response.h \
   session.c session.h
 

Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c   2007-06-13 07:00:59 UTC (rev 5029)
+++ libmicrohttpd/src/daemon/daemon.c   2007-06-13 07:03:22 UTC (rev 5030)
@@ -26,33 +26,14 @@
  * @version 0.1.0
  */
 
-#include "microhttpd.h"
 #include "internal.h"
 #include "response.h"
 #include "session.h"
-#include "config.h"
 
 #define MHD_MAX_CONNECTIONS FD_SETSIZE -4 
 
 
 /**
- * fprintf-like helper function for logging debug
- * messages.
- */
-static void DLOG(const struct MHD_Daemon * daemon,
-                const char * format,
-                ...) {
-  va_list va;
-  
-  if ( (daemon->options & MHD_USE_DEBUG) == 0)
-    return;
-  va_start(va, format);
-  vfprintf(stderr, format, va);
-  va_end(va);
-}
-
-
-/**
  * Register an access handler for all URIs beginning with uri_prefix.
  *
  * @param uri_prefix 
@@ -234,9 +215,9 @@
                         &addr,
                         &addrlen))) ||
        (addrlen <= 0) ) {
-    DLOG(daemon,
-        "Error accepting connection: %s\n",
-        strerror(errno));
+    MHD_DLOG(daemon,
+            "Error accepting connection: %s\n",
+            strerror(errno));
     return MHD_NO;
   }
   if (MHD_NO == daemon->apc(daemon->apc_cls,
@@ -261,9 +242,9 @@
                            NULL, 
                            &MHD_handle_connection, 
                            session)) ) {
-    DLOG(daemon,
-        "Failed to create a thread: %s\n",
-        strerror(errno));
+    MHD_DLOG(daemon,
+            "Failed to create a thread: %s\n",
+            strerror(errno));
     free(session->addr);
     close(s);
     free(session);
@@ -354,9 +335,9 @@
   if (num_ready < 0) {    
     if (errno == EINTR)
       return MHD_YES;
-    DLOG(daemon,
-        "Select failed: %s\n",
-        strerror(errno));
+    MHD_DLOG(daemon,
+            "Select failed: %s\n",
+            strerror(errno));
     return MHD_NO;    
   }
   if (FD_ISSET(daemon->socket_fd,

Added: libmicrohttpd/src/daemon/internal.c
===================================================================
--- libmicrohttpd/src/daemon/internal.c                         (rev 0)
+++ libmicrohttpd/src/daemon/internal.c 2007-06-13 07:03:22 UTC (rev 5030)
@@ -0,0 +1,47 @@
+/*
+     This file is part of libmicrohttpd
+     (C) 2007 Daniel Pittman
+
+     libmicrohttpd 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 2, or (at your
+     option) any later version.
+
+     libmicrohttpd 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 libmicrohttpd; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file internal.h
+ * @brief  internal shared structures
+ * @author Daniel Pittman
+ * @author Christian Grothoff
+ * @version 0.1.0
+ */
+
+#include "internal.h"
+
+
+/**
+ * fprintf-like helper function for logging debug
+ * messages.
+ */
+void MHD_DLOG(const struct MHD_Daemon * daemon,
+             const char * format,
+             ...) {
+  va_list va;
+  
+  if ( (daemon->options & MHD_USE_DEBUG) == 0)
+    return;
+  va_start(va, format);
+  vfprintf(stderr, format, va);
+  va_end(va);
+}
+


Property changes on: libmicrohttpd/src/daemon/internal.c
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: libmicrohttpd/src/daemon/internal.h
===================================================================
--- libmicrohttpd/src/daemon/internal.h 2007-06-13 07:00:59 UTC (rev 5029)
+++ libmicrohttpd/src/daemon/internal.h 2007-06-13 07:03:22 UTC (rev 5030)
@@ -48,7 +48,17 @@
 
 #define MAX(a,b) ((a)<(b)) ? (b) : (a)
 
+
 /**
+ * fprintf-like helper function for logging debug
+ * messages.
+ */
+void MHD_DLOG(const struct MHD_Daemon * daemon,
+             const char * format,
+             ...);
+
+
+/**
  * Header or cookie in HTTP request or response.
  */
 struct MHD_HTTP_Header {

Modified: libmicrohttpd/src/daemon/response.c
===================================================================
--- libmicrohttpd/src/daemon/response.c 2007-06-13 07:00:59 UTC (rev 5029)
+++ libmicrohttpd/src/daemon/response.c 2007-06-13 07:03:22 UTC (rev 5030)
@@ -26,10 +26,8 @@
  * @version 0.1.0
  */
 
-#include "microhttpd.h"
-#include "response.h"
 #include "internal.h"
-#include "config.h"
+#include "response.h"
 
 /**
  * Add a header line to the response.

Modified: libmicrohttpd/src/daemon/session.c
===================================================================
--- libmicrohttpd/src/daemon/session.c  2007-06-13 07:00:59 UTC (rev 5029)
+++ libmicrohttpd/src/daemon/session.c  2007-06-13 07:03:22 UTC (rev 5030)
@@ -26,11 +26,9 @@
  * @version 0.1.0
  */
 
-#include "microhttpd.h"
+#include "internal.h"
 #include "session.h"
 #include "response.h"
-#include "internal.h"
-#include "config.h"
 
 
 /**





reply via email to

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