Skip to content

Commit

Permalink
Client requested close takes precedence over server initiated close.
Browse files Browse the repository at this point in the history
When the client has already called webclient_close() it doesn't expect to have webclient_datahandler(NULL, 0) called just because the connection was closed by the server "at the same time". Rather it expects to always have webclient_closed() called.

Calling webclient_datahandler(NULL, 0) instead of webclient_closed() means that the web browser shows "Done" in the status line instead of "Stopped". So the user is mislead to think that he has already seen all of the page.

Note: webclient_close() is called by the client during newdata() so the already existing check for WEBCLIENT_STATE_CLOSE further above doesn't help.
  • Loading branch information
oliverschmidt committed Nov 1, 2015
1 parent 185be73 commit 1066bb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/webbrowser/webclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ webclient_appcall(void *state)

if(uip_closed()) {
tcp_markconn(uip_conn, NULL);
/* Client requested close takes precedence over server initiated close. */
if(s.state == WEBCLIENT_STATE_CLOSE) {
webclient_closed();
return;
}
switch(s.httpflag) {
case HTTPFLAG_HTTPS:
/* Send some info to the user. */
Expand Down

0 comments on commit 1066bb1

Please sign in to comment.