Ver código fonte

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 anos atrás
pai
commit
38ae94f8ce
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5
    2
      src/net/tcp/iscsi.c

+ 5
- 2
src/net/tcp/iscsi.c Ver arquivo

@@ -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
 

Carregando…
Cancelar
Salvar