From d703a2df44aedea9af4b9125fb059f8bf6582e5f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 13 Mar 2014 14:02:50 +0000 Subject: [PATCH] From Stephan Huber, "attached is a fix for the rest-http-plugin which should fix the font-issue reported by Phil. The old implementation did forward all requests to the internal http-server via user-events. This prevented error-reporting for missing files, as the request was accidentally handled by the plugin. As a request for missing font-file succeeds and returned an empty file, the curl-plugin hands the data happily to the freetype-plugin which failed trying to load an empty font-file, obviously. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My fix was to rename the standard request handler to a specialized user-event-handler which handles only requests for "/user-event“ So fonts should work on iOS when loaded remotely, even when a local file is available and with the resthttp-plugin serving the presentation. " --- src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp b/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp index d3a380458..76268006d 100644 --- a/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp +++ b/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp @@ -20,9 +20,9 @@ namespace RestHttp { -class StandardRequestHandler : public RestHttpDevice::RequestHandler { +class UserEventRequestHandler : public RestHttpDevice::RequestHandler { public: - StandardRequestHandler() : RestHttpDevice::RequestHandler("") {} + UserEventRequestHandler() : RestHttpDevice::RequestHandler("/user-event") {} virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const Arguments& arguments, http::server::reply& reply) { OSG_INFO << "RestHttpDevice :: handling request " << full_request_path << " as user-event" << std::endl; @@ -293,7 +293,7 @@ RestHttpDevice::RestHttpDevice(const std::string& listening_address, const std:: addRequestHandler(new RestHttp::HomeRequestHandler()); - addRequestHandler(new RestHttp::StandardRequestHandler()); + addRequestHandler(new RestHttp::UserEventRequestHandler()); // start the thread start();