From 970defc9fed04ddf12845680366077bef0732631 Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Sun, 7 Nov 2010 20:32:57 -0500
Subject: [PATCH] libfawkeswebview: libmicrohttpd 0.9.2 compatibility
---
src/libs/webview/request_dispatcher.cpp | 18 +++++++++++-------
src/libs/webview/request_dispatcher.h | 3 ---
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/libs/webview/request_dispatcher.cpp b/src/libs/webview/request_dispatcher.cpp
index 8b3b8fe..a322f10 100644
--- a/src/libs/webview/request_dispatcher.cpp
+++ b/src/libs/webview/request_dispatcher.cpp
@@ -94,9 +94,13 @@ WebRequestDispatcher::process_request_cb(void *callback_data,
* @param max maximum number of bytes that can be put in buf
* @return suitable libmicrohttpd return code
*/
-int
-WebRequestDispatcher::dynamic_reply_data_cb(void *reply,
- uint64_t pos, char *buf, int max)
+#if MHD_VERSION >= 0x00090200
+static ssize_t
+dynamic_reply_data_cb(void *reply, uint64_t pos, char *buf, size_t max)
+#else
+static int
+dynamic_reply_data_cb(void *reply, uint64_t pos, char *buf, int max)
+#endif
{
DynamicWebReply *dreply = static_cast<DynamicWebReply *>(reply);
return dreply->next_chunk(pos, buf, max);
@@ -106,8 +110,8 @@ WebRequestDispatcher::dynamic_reply_data_cb(void *reply,
/** Callback to free dynamic web reply.
* @param reply Instance of DynamicWebReply to free.
*/
-void
-WebRequestDispatcher::dynamic_reply_free_cb(void *reply)
+static void
+dynamic_reply_free_cb(void *reply)
{
DynamicWebReply *dreply = static_cast<DynamicWebReply *>(reply);
delete dreply;
@@ -236,9 +240,9 @@ WebRequestDispatcher::process_request(struct MHD_Connection * connection,
} else if (dreply) {
response = MHD_create_response_from_callback(dreply->size(),
dreply->chunk_size(),
- WebRequestDispatcher::dynamic_reply_data_cb,
+ dynamic_reply_data_cb,
dreply,
- WebRequestDispatcher::dynamic_reply_free_cb);
+ dynamic_reply_free_cb);
ret = MHD_queue_response (connection, dreply->code(), response);
MHD_destroy_response (response);
} else {
diff --git a/src/libs/webview/request_dispatcher.h b/src/libs/webview/request_dispatcher.h
index 79ed82f..bff1264 100644
--- a/src/libs/webview/request_dispatcher.h
+++ b/src/libs/webview/request_dispatcher.h
@@ -58,9 +58,6 @@ class WebRequestDispatcher
size_t *upload_data_size,
void **session_data);
- static int dynamic_reply_data_cb(void *reply, uint64_t pos, char *buf, int max);
- static void dynamic_reply_free_cb(void *reply);
-
int queue_static_reply(struct MHD_Connection * connection,
StaticWebReply *sreply);
int process_request(struct MHD_Connection * connection,
--
1.7.2.3