Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Close existing connection and discard compressed packet in cstp_recon…
…nect()

Both callers need to do this, so move it into the function.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 12, 2010
1 parent 9d2b41d commit 54bad6a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cstp.c
Expand Up @@ -403,6 +403,13 @@ int cstp_reconnect(struct openconnect_info *vpninfo)
int timeout;
int interval;

openconnect_close_https(vpninfo);

/* It's already deflated in the old stream. Extremely
non-trivial to reconstitute it; just throw it away */
if (vpninfo->current_ssl_pkt == vpninfo->deflate_pkt)
vpninfo->current_ssl_pkt = NULL;

timeout = vpninfo->reconnect_timeout;
interval = vpninfo->reconnect_interval;

Expand Down Expand Up @@ -626,13 +633,6 @@ int cstp_mainloop(struct openconnect_info *vpninfo, int *timeout)
peer_dead:
vpninfo->progress(vpninfo, PRG_ERR, "CSTP Dead Peer Detection detected dead peer!\n");
do_reconnect:
openconnect_close_https(vpninfo);

/* It's already deflated in the old stream. Extremely
non-trivial to reconstitute it; just throw it away */
if (vpninfo->current_ssl_pkt == vpninfo->deflate_pkt)
vpninfo->current_ssl_pkt = NULL;

if (cstp_reconnect(vpninfo)) {
vpninfo->progress(vpninfo, PRG_ERR, "Reconnect failed\n");
vpninfo->quit_reason = "CSTP reconnect failed";
Expand Down

0 comments on commit 54bad6a

Please sign in to comment.