Explorar o código

Addresses hudson build issue on solaris - see ZOOKEEPER-45 fix_solaris_test.patch

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@672435 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt %!s(int64=17) %!d(string=hai) anos
pai
achega
7a56a8f5e5
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      src/java/main/org/apache/zookeeper/ClientCnxn.java

+ 4 - 4
src/java/main/org/apache/zookeeper/ClientCnxn.java

@@ -349,7 +349,7 @@ class ClientCnxn {
         if (p.watchRegistration != null) {
         if (p.watchRegistration != null) {
             p.watchRegistration.register(p.replyHeader.getErr());
             p.watchRegistration.register(p.replyHeader.getErr());
         }
         }
-        
+
         p.finished = true;
         p.finished = true;
         if (p.cb == null) {
         if (p.cb == null) {
             synchronized (p) {
             synchronized (p) {
@@ -597,6 +597,7 @@ class ClientCnxn {
             synchronized (this) {
             synchronized (this) {
                 k.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
                 k.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
             }
             }
+            zooKeeper.state = States.CONNECTED;
         }
         }
 
 
         private void sendPing() {
         private void sendPing() {
@@ -697,7 +698,6 @@ class ClientCnxn {
                         SocketChannel sc = ((SocketChannel) k.channel());
                         SocketChannel sc = ((SocketChannel) k.channel());
                         if ((k.readyOps() & SelectionKey.OP_CONNECT) != 0) {
                         if ((k.readyOps() & SelectionKey.OP_CONNECT) != 0) {
                             if (sc.finishConnect()) {
                             if (sc.finishConnect()) {
-                                zooKeeper.state = States.CONNECTED;
                                 lastHeard = now;
                                 lastHeard = now;
                                 lastSend = now;
                                 lastSend = now;
                                 primeConnection(k);
                                 primeConnection(k);
@@ -809,10 +809,10 @@ class ClientCnxn {
     public ReplyHeader submitRequest(RequestHeader h, Record request,
     public ReplyHeader submitRequest(RequestHeader h, Record request,
             Record response,
             Record response,
             WatchRegistration watchRegistration)
             WatchRegistration watchRegistration)
-        throws InterruptedException 
+        throws InterruptedException
     {
     {
         ReplyHeader r = new ReplyHeader();
         ReplyHeader r = new ReplyHeader();
-        Packet packet = 
+        Packet packet =
             queuePacket(h, r, request, response, null, null, null,
             queuePacket(h, r, request, response, null, null, null,
                     watchRegistration);
                     watchRegistration);
         synchronized (packet) {
         synchronized (packet) {