Skip to content

Commit

Permalink
Merge pull request #1111 from bbockelm/remove_duplicate_quote
Browse files Browse the repository at this point in the history
Remove duplicate version of `quote` function.
  • Loading branch information
simonmichal committed Jan 21, 2020
2 parents 69de3f4 + 7cec54c commit b95f6f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 42 deletions.
3 changes: 2 additions & 1 deletion src/XrdHttp/XrdHttpUtils.hh
Expand Up @@ -35,7 +35,8 @@
*
*/


#include "XProtocol/XPtypes.hh"
#include "XrdSec/XrdSecEntity.hh"

#ifndef XRDHTTPUTILS_HH
#define XRDHTTPUTILS_HH
Expand Down
41 changes: 0 additions & 41 deletions src/XrdTpc/XrdTpcTPC.cc
Expand Up @@ -68,47 +68,6 @@ static std::string prepareURL(XrdHttpExtReq &req) {
}


static char *quote(const char *str) {
int l = strlen(str);
char *r = (char *) malloc(l*3 + 1);
r[0] = '\0';
int i, j = 0;

for (i = 0; i < l; i++) {
char c = str[i];

switch (c) {
case ' ':
strcpy(r + j, "%20");
j += 3;
break;
case '[':
strcpy(r + j, "%5B");
j += 3;
break;
case ']':
strcpy(r + j, "%5D");
j += 3;
break;
case ':':
strcpy(r + j, "%3A");
j += 3;
break;
case '/':
strcpy(r + j, "%2F");
j += 3;
break;
default:
r[j++] = c;
}
}

r[j] = '\0';

return r;
}


bool TPCHandler::MatchesPath(const char *verb, const char *path) {
return !strcmp(verb, "COPY") || !strcmp(verb, "OPTIONS");
}
Expand Down
1 change: 1 addition & 0 deletions src/XrdTpc/XrdTpcTPC.hh
Expand Up @@ -6,6 +6,7 @@
#include "XrdSys/XrdSysPthread.hh"

#include "XrdHttp/XrdHttpExtHandler.hh"
#include "XrdHttp/XrdHttpUtils.hh"

class XrdOucErrInfo;
class XrdOucStream;
Expand Down

0 comments on commit b95f6f1

Please sign in to comment.