mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
[xfer] Implement xfer_vreopen() to properly handle redirections
When handling a redirection event, we need to close the existing connection before opening the new connection.
This commit is contained in:
@@ -335,7 +335,7 @@ static int ftp_control_deliver_raw ( struct xfer_interface *control,
|
||||
/** FTP control channel operations */
|
||||
static struct xfer_interface_operations ftp_control_operations = {
|
||||
.close = ftp_control_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = xfer_deliver_as_raw,
|
||||
@@ -402,7 +402,7 @@ static int ftp_data_deliver_iob ( struct xfer_interface *data,
|
||||
/** FTP data channel operations */
|
||||
static struct xfer_interface_operations ftp_data_operations = {
|
||||
.close = ftp_data_closed,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = ftp_data_deliver_iob,
|
||||
|
||||
@@ -464,7 +464,7 @@ static void http_socket_close ( struct xfer_interface *socket, int rc ) {
|
||||
/** HTTP socket operations */
|
||||
static struct xfer_interface_operations http_socket_operations = {
|
||||
.close = http_socket_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = http_socket_deliver_iob,
|
||||
|
||||
@@ -1514,7 +1514,7 @@ static int iscsi_vredirect ( struct xfer_interface *socket, int type,
|
||||
va_end ( tmp );
|
||||
}
|
||||
|
||||
return xfer_vopen ( socket, type, args );
|
||||
return xfer_vreopen ( socket, type, args );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1625,7 +1625,7 @@ static int tls_cipherstream_deliver_raw ( struct xfer_interface *xfer,
|
||||
/** TLS ciphertext stream operations */
|
||||
static struct xfer_interface_operations tls_cipherstream_operations = {
|
||||
.close = tls_cipherstream_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = filter_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = xfer_deliver_as_raw,
|
||||
|
||||
@@ -1107,7 +1107,7 @@ static int dhcp_deliver_iob ( struct xfer_interface *xfer,
|
||||
/** DHCP data transfer interface operations */
|
||||
static struct xfer_interface_operations dhcp_xfer_operations = {
|
||||
.close = ignore_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = dhcp_deliver_iob,
|
||||
|
||||
@@ -459,7 +459,7 @@ static void dns_xfer_close ( struct xfer_interface *socket, int rc ) {
|
||||
/** DNS socket operations */
|
||||
static struct xfer_interface_operations dns_socket_operations = {
|
||||
.close = dns_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = xfer_deliver_as_raw,
|
||||
|
||||
@@ -614,7 +614,7 @@ static void slam_socket_close ( struct xfer_interface *socket, int rc ) {
|
||||
/** SLAM unicast socket data transfer operations */
|
||||
static struct xfer_interface_operations slam_socket_operations = {
|
||||
.close = slam_socket_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = slam_socket_deliver,
|
||||
@@ -640,7 +640,7 @@ static void slam_mc_socket_close ( struct xfer_interface *mc_socket, int rc ){
|
||||
/** SLAM multicast socket data transfer operations */
|
||||
static struct xfer_interface_operations slam_mc_socket_operations = {
|
||||
.close = slam_mc_socket_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = slam_mc_socket_deliver,
|
||||
|
||||
@@ -934,7 +934,7 @@ static int tftp_socket_deliver_iob ( struct xfer_interface *socket,
|
||||
/** TFTP socket operations */
|
||||
static struct xfer_interface_operations tftp_socket_operations = {
|
||||
.close = ignore_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = tftp_socket_deliver_iob,
|
||||
@@ -961,7 +961,7 @@ static int tftp_mc_socket_deliver_iob ( struct xfer_interface *mc_socket,
|
||||
/** TFTP multicast socket operations */
|
||||
static struct xfer_interface_operations tftp_mc_socket_operations = {
|
||||
.close = ignore_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.vredirect = xfer_vreopen,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = tftp_mc_socket_deliver_iob,
|
||||
|
||||
Reference in New Issue
Block a user