Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Allow to remove libmicrohttpd (HTTP server)
[src/app-framework-binder.git]
/
src
/
afb-hreq.c
diff --git
a/src/afb-hreq.c
b/src/afb-hreq.c
index
a2df4b1
..
49c1692
100644
(file)
--- a/
src/afb-hreq.c
+++ b/
src/afb-hreq.c
@@
-15,6
+15,8
@@
* limitations under the License.
*/
* limitations under the License.
*/
+#if WITH_LIBMICROHTTPD
+
#define _GNU_SOURCE
#include <stdlib.h>
#define _GNU_SOURCE
#include <stdlib.h>
@@
-31,7
+33,7
@@
#define JSON_C_TO_STRING_NOSLASHESCAPE 0
#endif
#define JSON_C_TO_STRING_NOSLASHESCAPE 0
#endif
-#if
defined(USE_MAGIC_MIME_TYPE)
+#if
USE_MAGIC_MIME_TYPE
#include <magic.h>
#endif
#include <magic.h>
#endif
@@
-218,7
+220,7
@@
void afb_hreq_reply_free(struct afb_hreq *hreq, unsigned status, size_t size, ch
va_end(args);
}
va_end(args);
}
-#if
defined(USE_MAGIC_MIME_TYPE)
+#if
USE_MAGIC_MIME_TYPE
#if !defined(MAGIC_DB)
#define MAGIC_DB "/usr/share/misc/magic.mgc"
#if !defined(MAGIC_DB)
#define MAGIC_DB "/usr/share/misc/magic.mgc"
@@
-262,7
+264,7
@@
static const char *mimetype_fd_name(int fd, const char *filename)
{
const char *result = NULL;
{
const char *result = NULL;
-#if
defined(INFER_EXTENSION)
+#if
INFER_EXTENSION
/*
* Set some well-known extensions
* Note that it is mandatory for example for css files in order to provide
/*
* Set some well-known extensions
* Note that it is mandatory for example for css files in order to provide
@@
-307,7
+309,7
@@
static const char *mimetype_fd_name(int fd, const char *filename)
}
}
#endif
}
}
#endif
-#if
defined(USE_MAGIC_MIME_TYPE)
+#if
USE_MAGIC_MIME_TYPE
if (result == NULL)
result = magic_mimetype_fd(fd);
#endif
if (result == NULL)
result = magic_mimetype_fd(fd);
#endif
@@
-1001,3
+1003,4
@@
struct afb_hreq *afb_hreq_create()
return hreq;
}
return hreq;
}
+#endif