Browse Source

A cleaner method of handling login redirection; just use the existing

reconnection mechanism.  This avoids the problems of trying to reuse
the TCP connection structure before the old connection has cleanly exited.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
38ae94f8ce
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/net/tcp/iscsi.c

+ 5
- 2
src/net/tcp/iscsi.c View File

@@ -735,8 +735,11 @@ static void iscsi_rx_login_response ( struct iscsi_session *iscsi, void *data,
735 735
 	/* Check for login redirection */
736 736
 	if ( response->status_class == ISCSI_STATUS_REDIRECT ) {
737 737
 		DBG ( "iSCSI %p redirecting to new server\n", iscsi );
738
-		iscsi_close ( iscsi, -EINPROGRESS );
739
-		tcp_connect ( &iscsi->tcp );
738
+		/* Close the TCP connection; our TCP closed() method
739
+		 * will take care of the reconnection once this
740
+		 * connection has been cleanly terminated.
741
+		 */
742
+		tcp_close ( &iscsi->tcp );
740 743
 		return;
741 744
 	}
742 745
 

Loading…
Cancel
Save