|
From: CVS C. to T. <the...@li...> - 2015-04-26 16:44:52
|
Revision: 723
http://sourceforge.net/p/themis/code/723
Author: mark_hellegers
Date: 2015-04-26 16:44:50 +0000 (Sun, 26 Apr 2015)
Log Message:
-----------
- Remove synchronous retry as it does not seem to do anything.
- Make sure we indicate we are done with the request when we could not get a connection.
Modified Paths:
--------------
trunk/themis/modules/http/httpv4.cpp
Modified: trunk/themis/modules/http/httpv4.cpp
===================================================================
--- trunk/themis/modules/http/httpv4.cpp 2015-04-26 16:42:26 UTC (rev 722)
+++ trunk/themis/modules/http/httpv4.cpp 2015-04-26 16:44:50 UTC (rev 723)
@@ -563,41 +563,29 @@
if (current->connection==connection)
{
current->internal_status|=STATUS_CONNECTION_CLOSED;
- if ((current->internal_status&STATUS_CONNECTED_TO_SERVER)==0)
- {//we never got connected before we got the terminated notification
- if ((current->internal_status&STATUS_NO_RESPONSE_FROM_SERVER)==0)
+ if ((current->internal_status&STATUS_CONNECTED_TO_SERVER)==0) {
+ //We never got connected before we got the terminated notification.
+ //Maybe the server isn't up or listening...
+ BMessage disconnect(SH_LOADING_PROGRESS);
+ disconnect.AddInt32("command",COMMAND_INFO);
+ disconnect.AddInt32("site_id",current->site_id);
+ disconnect.AddInt32("url_id",current->url_id);
+ disconnect.AddString("url",current->url);
+ disconnect.AddInt64("bytes-received",current->bytes_received);
+ disconnect.AddBool("request_done",true);
+ disconnect.AddBool("secure",current->secure);
+ disconnect.AddBool("aborted",true);
+ if (current->content_type!=NULL)
{
- //The original attempt to connect to the server asynchronously failed.
- //Try again synchronously.
-// printf("HTTPv4: Switching to synchronous socket for host %s\n",current->host);
- //tcp_manager->Disconnect(connection);//DoneWithSession(connection);
- current->connection->OwnerRelease();
- current->connection=NULL;
- current->internal_status^=(STATUS_CONNECTION_CLOSED|STATUS_NO_RESPONSE_FROM_SERVER);
-// current->connection=tcp_manager->CreateConnection(this,current->host,current->port,current->secure,false);
- } else
- {
- //The synchronous attempt also failed... Maybe the server isn't up or listening...
- BMessage disconnect(SH_LOADING_PROGRESS);
- disconnect.AddInt32("command",COMMAND_INFO);
- disconnect.AddInt32("site_id",current->site_id);
- disconnect.AddInt32("url_id",current->url_id);
- disconnect.AddString("url",current->url);
- disconnect.AddInt64("bytes-received",current->bytes_received);
- disconnect.AddBool("request_done",true);
- disconnect.AddBool("secure",current->secure);
- disconnect.AddBool("aborted",true);
- if (current->content_type!=NULL)
- {
- disconnect.AddString("content-type",current->content_type);
- disconnect.AddString("mime-type",current->content_type);
- }
- Broadcast(MS_TARGET_ALL,&disconnect);
- current->connection->OwnerRelease();
- current->connection=NULL;
- // tcp_manager->DoneWithSession(connection);
- current->internal_status|=(STATUS_NO_RESPONSE_FROM_SERVER|STATUS_NO_DATA_FROM_SERVER|STATUS_CONNECTION_CLOSED);
+ disconnect.AddString("content-type",current->content_type);
+ disconnect.AddString("mime-type",current->content_type);
}
+ Broadcast(MS_TARGET_ALL,&disconnect);
+ current->connection->OwnerRelease();
+ current->connection=NULL;
+ // tcp_manager->DoneWithSession(connection);
+ current->internal_status|=(STATUS_NO_RESPONSE_FROM_SERVER|STATUS_NO_DATA_FROM_SERVER|STATUS_CONNECTION_CLOSED);
+ DoneWithRequest(current);
} else
{//connected to server successfully, now disconnecting...
current->internal_status|=STATUS_CONNECTION_CLOSED;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|