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

fix #2007 http: Call callback in all cases #2020

Merged
merged 5 commits into from
Jul 1, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions app/http/httpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,20 +451,32 @@ static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
struct espconn * conn = (struct espconn *) arg;
if ( conn == NULL )
{
HTTPCLIENT_ERR( "Connection is NULL" );
return;
}
if ( conn->reverse == NULL )
{
HTTPCLIENT_ERR( "reverse is NULL" );
return;
}
request_args_t * req = (request_args_t *) conn->reverse;
HTTPCLIENT_ERR( "Calling disconnect" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be HTTPCLIENT_DEBUG?

/* Call disconnect */
sint8 result;
#ifdef CLIENT_SSL_ENABLE
if ( req->secure )
espconn_secure_disconnect( conn );
result = espconn_secure_disconnect( conn );
else
#endif
espconn_disconnect( conn );
result = espconn_disconnect( conn );

if (result == ESPCONN_OK || result == ESPCONN_INPROGRESS)
return;
else
{
HTTPCLIENT_ERR( "manually Calling disconnect callback due to error %d", result );
http_disconnect_callback( arg );
}
}


Expand Down