r10836: giving NT_STATUS_NO_MEMORY, when the connection fails wasn't a good idea...
authorStefan Metzmacher <metze@samba.org>
Sat, 8 Oct 2005 16:35:33 +0000 (16:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:33 +0000 (13:39 -0500)
metze
(This used to be commit e7ee73a747a025a66ac6563172e51f160bc28e0a)

source4/libcli/wrepl/winsrepl.c

index 31ef1ffbebadbf2898015bda6e3a4e60b7ff8671..82abd766657f42c58f39e39de90976074e9456a5 100644 (file)
@@ -433,6 +433,7 @@ static NTSTATUS wrepl_request_wait(struct wrepl_request *req)
        return req->status;
 }
 
+static void wrepl_request_trigger(struct wrepl_request *req);
 
 /*
   connect a wrepl_socket to a WINS server
@@ -459,7 +460,13 @@ struct wrepl_request *wrepl_connect_send(struct wrepl_socket *wrepl_socket,
 
        status = socket_connect(wrepl_socket->sock, our_ip, 0, peer_ip, 
                                WINS_REPLICATION_PORT, 0);
-       if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) goto failed;
+       if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+               req->wrepl_socket = wrepl_socket;
+               req->state        = WREPL_REQUEST_ERROR;
+               req->status       = status;
+               wrepl_request_trigger(req);
+               return req;
+       }
 
        return req;