disregard CONNECT requests for now

This commit is contained in:
Matt Wells 2014-11-01 06:17:36 -07:00
parent 8bb3545b71
commit 45972d9837
2 changed files with 11 additions and 7 deletions

@ -479,18 +479,19 @@ bool HttpRequest::set ( char *origReq , long origReqLen , TcpSocket *sock ) {
cmdLen = 4;
}
else if ( strncmp ( req , "CONNECT " , 8 ) == 0 ) {
m_requestType = RT_CONNECT;
cmdLen = 7;
// take this out until it stops losing descriptors and works
//m_requestType = RT_CONNECT;
//cmdLen = 7;
// we no longer insert section info. emmanuel gets section
// info when injecting a doc now i think in PageInject.cpp.
// we do not proxy https requests because we can't
// decrypt the page contents to cache them or to insert
// the sectiondb voting markup, so it's kinda pointless...
// and i'm not aiming to be a full-fledge squid proxy.
//log("http: CONNECT request not supported because we "
// "can't insert section markup and we can't cache: %s",req);
//g_errno = EBADREQUEST;
//return false;
log("http: CONNECT request not supported because we "
"can't insert section markup and we can't cache: %s",req);
g_errno = EBADREQUEST;
return false;
}
else {
log("http: got bad request cmd: %s",req);

@ -197,8 +197,11 @@ bool HttpServer::getDoc ( char *url ,
// request being sent to a proxy we have to
// say "GET http://www.xyz.com/" the full
// url, not just a relative path.
additionalHeader , pcLen , proxyIp ) )
additionalHeader , pcLen , proxyIp ) ) {
log("http: got bad http req = %s",mstrerror(g_errno));
// TODO: ensure we close the socket on this error!
return true;
}
reqSize = r.getRequestLen();
long need = reqSize + pcLen;
// if we are requesting an HTTPS url through a proxy then