Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to XrdHTTP #73

Merged
merged 1 commit into from Jan 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/XrdHTTP/XrdHttpProtocol.cc
Expand Up @@ -35,7 +35,7 @@
#include "XrdHttpTrace.hh"
#include "XrdHttpProtocol.hh"
//#include "XrdXrootd/XrdXrootdStats.hh"
#include <boost/lexical_cast.hpp>

#include <sys/stat.h>
#include "XrdHttpUtils.hh"
#include "XrdHttpSecXtractor.hh"
Expand Down Expand Up @@ -1283,7 +1283,7 @@ int XrdHttpProtocol::InitSecurity() {

const SSL_METHOD *meth;
meth = SSLv23_method();
sslctx = SSL_CTX_new(meth);
sslctx = SSL_CTX_new((SSL_METHOD *)meth);
SSL_CTX_set_options(sslctx, SSL_OP_NO_SSLv2);
SSL_CTX_set_session_cache_mode(sslctx, SSL_SESS_CACHE_SERVER);
SSL_CTX_set_session_id_context(sslctx, s_server_session_id_context,
Expand Down
9 changes: 4 additions & 5 deletions src/XrdHTTP/XrdHttpReq.cc
Expand Up @@ -48,7 +48,6 @@
#include "Xrd/XrdLink.hh"
#include "XrdXrootd/XrdXrootdBridge.hh"
#include "Xrd/XrdBuffer.hh"
#include <boost/lexical_cast.hpp>

#include <algorithm>
#include <functional>
Expand Down Expand Up @@ -1334,8 +1333,8 @@ int XrdHttpReq::PostProcessHTTPReq(bool final) {
else p += "-";

p += "</td>";
p += "<td class=\"mode\">" + boost::lexical_cast<string > (e.flags) + "</td>"
"<td class=\"size\">" + boost::lexical_cast<string > (e.size) + "</td>"
p += "<td class=\"mode\">" + itos(e.flags) + "</td>"
"<td class=\"size\">" + itos(e.size) + "</td>"
"<td class=\"datetime\">" + ISOdatetime(e.modtime) + "</td>"
"<td class=\"name\">"
"<a href=\"";
Expand Down Expand Up @@ -1729,7 +1728,7 @@ int XrdHttpReq::PostProcessHTTPReq(bool final) {

// File size
stringresp += "<lp1:getcontentlength>";
stringresp += boost::lexical_cast<std::string > (e.size);
stringresp += itos(e.size);
stringresp += "</lp1:getcontentlength>\n";


Expand Down Expand Up @@ -1840,7 +1839,7 @@ int XrdHttpReq::PostProcessHTTPReq(bool final) {

// File size
stringresp += "<lp1:getcontentlength>";
stringresp += boost::lexical_cast<std::string > (e.size);
stringresp += itos(e.size);
stringresp += "</lp1:getcontentlength>\n";

stringresp += "<lp1:getlastmodified>";
Expand Down
6 changes: 6 additions & 0 deletions src/XrdHTTP/XrdHttpUtils.cc
Expand Up @@ -139,7 +139,13 @@ void Tobase64(const unsigned char *input, int length, char *out) {



// Simple itoa function
std::string itos(long i) {
char buf[128];
sprintf(buf, "%ld", i);

return buf;
}



Expand Down
2 changes: 2 additions & 0 deletions src/XrdHTTP/XrdHttpUtils.hh
Expand Up @@ -46,6 +46,8 @@
// Return 0 if OK
int parseURL(char *url, char *host, int &port, char **path);

// Simple itoa function
std::string itos(long i);

void calcHashes(
char *hash,
Expand Down