Skip to content

Commit

Permalink
Remove duplicate version of quote function.
Browse files Browse the repository at this point in the history
The `quote` function was copy-pasted into the standalone xrootd-http-tpc
package before that package was integrated back into the mainline
`xrootd` source code.  Now that XrdTpc is in the same source repo,
there's no need for this duplicate function.

Remove it!
  • Loading branch information
bbockelm committed Jan 14, 2020
1 parent 12b479b commit 7cec54c
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 7cec54c

Please sign in to comment.