tBoth clients now follow HTTP redirects properly - vaccinewars - be a doctor an… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit a1952c3b817dae1e9e9835751e2fe5dfe3e1fed5 | |
parent 6a9bc51c5cbdc06a9f7c5d49b4331755d54c9f55 | |
Author: Ben Webb <[email protected]> | |
Date: Thu, 4 Oct 2001 18:36:38 +0000 | |
Both clients now follow HTTP redirects properly | |
Diffstat: | |
M src/curses_client.c | 2 +- | |
M src/gtk_client.c | 2 +- | |
M src/message.c | 4 ++-- | |
3 files changed, 4 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/src/curses_client.c b/src/curses_client.c | |
t@@ -263,7 +263,7 @@ static gboolean SelectServerFromMetaServer(Player *Play,GS… | |
if (RespondToSelect(&MetaConn->NetBuf,&readfds,&writefds,NULL,&DoneOK)) { | |
while (HandleWaitingMetaServerData(MetaConn,&ServerList)) {} | |
} | |
- if (!DoneOK) { | |
+ if (!DoneOK && HandleHttpCompletion(MetaConn)) { | |
if (IsHttpError(MetaConn)) { | |
g_string_assign_error(errstr,&MetaConn->NetBuf.error); | |
CloseHttpConnection(MetaConn); | |
diff --git a/src/gtk_client.c b/src/gtk_client.c | |
t@@ -2045,7 +2045,7 @@ static void HandleMetaSock(gpointer data,gint socket, | |
while (HandleWaitingMetaServerData(widgets->MetaConn, | |
&widgets->NewMetaList)) {} | |
} | |
- if (!DoneOK) { | |
+ if (!DoneOK && HandleHttpCompletion(widgets->MetaConn)) { | |
ConnectError(widgets,TRUE); | |
CloseHttpConnection(widgets->MetaConn); | |
widgets->MetaConn=NULL; | |
diff --git a/src/message.c b/src/message.c | |
t@@ -322,7 +322,7 @@ gboolean HandleWaitingMetaServerData(HttpConnection *conn,… | |
/* If we're done reading the headers, only read if the data for a whole | |
server is available (8 lines) N.B. "Status" is from the _last_ read */ | |
- if (conn->Status==HS_READBODY) { | |
+ if (conn->Status==HS_READBODY && conn->StatusCode==200) { | |
if (CountWaitingMessages(&conn->NetBuf)<8) return FALSE; | |
NewServer=g_new0(ServerData,1); | |
t@@ -341,7 +341,7 @@ gboolean HandleWaitingMetaServerData(HttpConnection *conn,… | |
NewServer->Comment=ReadHttpResponse(conn); | |
NewServer->UpSince=ReadHttpResponse(conn); | |
*listpt=g_slist_append(*listpt,NewServer); | |
- } else if (conn->Status==HS_READSEPARATOR) { | |
+ } else if (conn->Status==HS_READSEPARATOR && conn->StatusCode==200) { | |
/* This should be the first line of the body, the "MetaServer:" line */ | |
msg=ReadHttpResponse(conn); | |
if (!msg) return FALSE; |