mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: HttpRequest added BEGIN phase
git-svn-id: svn://ultimatepp.org/upp/trunk@4793 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
994ab898db
commit
1c7292e6fc
3 changed files with 7 additions and 5 deletions
|
|
@ -29,7 +29,7 @@ void HttpRequest::Init()
|
|||
std_headers = true;
|
||||
hasurlvar = false;
|
||||
method = METHOD_GET;
|
||||
phase = START;
|
||||
phase = BEGIN;
|
||||
redirect_count = 0;
|
||||
retry_count = 0;
|
||||
gzip = false;
|
||||
|
|
@ -222,10 +222,11 @@ bool HttpRequest::Do()
|
|||
{
|
||||
int c1, c2;
|
||||
switch(phase) {
|
||||
case START:
|
||||
case BEGIN:
|
||||
retry_count = 0;
|
||||
redirect_count = 0;
|
||||
start_time = msecs();
|
||||
case START:
|
||||
Start();
|
||||
break;
|
||||
case DNS:
|
||||
|
|
@ -304,7 +305,7 @@ bool HttpRequest::Do()
|
|||
if(retry_count++ < max_retries) {
|
||||
LLOG("HTTP retry on error " << GetErrorDesc());
|
||||
start_time = msecs();
|
||||
Start();
|
||||
StartPhase(START);
|
||||
}
|
||||
}
|
||||
return phase != FINISHED && phase != FAILED;
|
||||
|
|
@ -663,6 +664,7 @@ String HttpRequest::Execute()
|
|||
String HttpRequest::GetPhaseName() const
|
||||
{
|
||||
static const char *m[] = {
|
||||
"Initial state",
|
||||
"Start",
|
||||
"Resolving host name",
|
||||
"SSL proxy request",
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ public:
|
|||
void ClearContent() { body.Clear(); }
|
||||
|
||||
enum Phase {
|
||||
START, DNS,
|
||||
BEGIN, START, DNS,
|
||||
SSLPROXYREQUEST, SSLPROXYRESPONSE, SSLHANDSHAKE,
|
||||
REQUEST, HEADER, BODY,
|
||||
CHUNK_HEADER, CHUNK_BODY, TRAILER,
|
||||
|
|
|
|||
|
|
@ -806,7 +806,7 @@ bool TcpSocket::StartSSL()
|
|||
SetSockError("StartSSL", -1, "Socket is not open");
|
||||
return false;
|
||||
}
|
||||
if(!IsOpen()) {
|
||||
if(mode != CONNECT && mode != ACCEPT) {
|
||||
SetSockError("StartSSL", -1, "Socket is not connected");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue