esc/esc-1.1.0-fix19.patch

80 lines
2.8 KiB
Diff

diff -up ./esc/src/app/xul/esc/application.ini.fix19 ./esc/src/app/xul/esc/application.ini
--- ./esc/src/app/xul/esc/application.ini.fix19 2014-04-23 14:42:02.644058331 -0700
+++ ./esc/src/app/xul/esc/application.ini 2014-04-23 14:42:22.990803962 -0700
@@ -25,11 +25,11 @@ Vendor=RedHat
Name=ESC
;
; This field specifies your application's version. This field is optional.
-Version=1.1.0-23
+Version=1.1.0-24
;
; This field specifies your application's build ID (timestamp). This field is
; required.
-BuildID=0000001023
+BuildID=0000001024
;
; This ID is just an example. Every XUL app ought to have it's own unique ID.
; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
diff -up ./esc/src/lib/NssHttpClient/Util.cpp.fix19 ./esc/src/lib/NssHttpClient/Util.cpp
--- ./esc/src/lib/NssHttpClient/Util.cpp.fix19 2014-04-23 14:40:14.001416551 -0700
+++ ./esc/src/lib/NssHttpClient/Util.cpp 2014-04-23 14:41:19.864593148 -0700
@@ -49,3 +49,26 @@ NSAPI_PUBLIC int Util::ascii2numeric (ch
}
return num;
}
+
+// Remove stray trailing CRLF chars, replace with provided char.
+NSAPI_PUBLIC void Util::stripTrailingCRLF(char *buff, char replaceWith)
+{
+ if(buff == NULL)
+ return;
+
+ if(replaceWith == 0)
+ return;
+
+ int buffLen = strlen(buff);
+
+ if(buffLen == 0)
+ return;
+
+ int buffLenMinusOne = buffLen - 1;
+
+ for(int i = buffLenMinusOne; i >= 0; i--) {
+ if(buff[i] == 0x0d || buff[i] == 0x0a) {
+ buff[i] = replaceWith;
+ }
+ }
+}
diff -up ./esc/src/lib/NssHttpClient/Util.h.fix19 ./esc/src/lib/NssHttpClient/Util.h
--- ./esc/src/lib/NssHttpClient/Util.h.fix19 2014-04-23 14:40:20.020341304 -0700
+++ ./esc/src/lib/NssHttpClient/Util.h 2014-04-23 14:41:30.120464932 -0700
@@ -34,6 +34,7 @@ class Util
~Util();
public:
NSAPI_PUBLIC static int ascii2numeric(char ch);
+ NSAPI_PUBLIC static void stripTrailingCRLF(char *buff, char replaceWith);
/* static char *Buffer2String (Buffer &data);
static Buffer *Str2Buf (const char *s);
static char *URLEncode (Buffer &data);
diff -up ./esc/src/lib/NssHttpClient/request.cpp.fix19 ./esc/src/lib/NssHttpClient/request.cpp
--- ./esc/src/lib/NssHttpClient/request.cpp.fix19 2014-04-23 14:40:27.207251455 -0700
+++ ./esc/src/lib/NssHttpClient/request.cpp 2014-04-23 14:41:38.935354731 -0700
@@ -25,6 +25,7 @@
#include "engine.h"
#include <prlog.h>
#include <time.h>
+#include "Util.h"
PRLogModuleInfo *httpLog = PR_NewLogModule("coolKeyHttpReq");
/**
@@ -283,6 +284,9 @@ PRBool PSHttpRequest::send( PRFileDesc *
if (strlen(_proxy_uri))
path = _proxy_uri;
+ //check for and replace stray line feed chars in path only.
+ Util::stripTrailingCRLF(path,' ');
+
data = PR_smprintf( "%s %s %s\r\n", _method, path,
HttpProtocolToString(_proto) );