From e65b28b47ecfd54b76d94a094297dddb2ad3fa04 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 22 Mar 2013 13:22:38 +0200 Subject: [PATCH] Drop Utils#parseHttpMessage The new modperl-based server does not send weird response messages, so the response message can be used without being transformed by this method. --- .../ieval/fonbot/HttpCallExecutableRunnable.java | 2 +- src/ro/ieval/fonbot/Utils.java | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java b/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java index 469f27d..e95dba7 100644 --- a/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java +++ b/src/ro/ieval/fonbot/HttpCallExecutableRunnable.java @@ -201,7 +201,7 @@ public final class HttpCallExecutableRunnable extends ExecutableRunnable{ if(message==null && callback != null) callback.onError(toNonNull(context.getString(no_response_returned_from_server))); else if(message != null && callback != null) - callback.onResult(conn.getResponseCode(), Utils.parseHttpMessage(message), + callback.onResult(conn.getResponseCode(), message, toNonNull(conn.getInputStream())); conn.disconnect(); } catch (Exception e) { diff --git a/src/ro/ieval/fonbot/Utils.java b/src/ro/ieval/fonbot/Utils.java index c699356..ddb506b 100644 --- a/src/ro/ieval/fonbot/Utils.java +++ b/src/ro/ieval/fonbot/Utils.java @@ -335,21 +335,6 @@ public final class Utils { } } - /** - * Parses a HTTP response message of the form (part1) part2, returning part2. - * - * @param message the raw HTTP response message - * @return the extracted part - */ - public static String parseHttpMessage(final String message){ - final int indexOfParen=message.indexOf(')'); - if(indexOfParen==-1) - return message; - if(indexOfParen == message.length()-1) - return toNonNull(message.substring(1, indexOfParen)); - return toNonNull(message.substring(indexOfParen+2)); - } - /** * Splits a string into words. * -- 2.39.2