瀏覽代碼

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 17 年之前
父節點
當前提交
7a56a8f5e5
共有 1 個文件被更改,包括 4 次插入4 次删除
  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) {
             p.watchRegistration.register(p.replyHeader.getErr());
         }
-        
+
         p.finished = true;
         if (p.cb == null) {
             synchronized (p) {
@@ -597,6 +597,7 @@ class ClientCnxn {
             synchronized (this) {
                 k.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
             }
+            zooKeeper.state = States.CONNECTED;
         }
 
         private void sendPing() {
@@ -697,7 +698,6 @@ class ClientCnxn {
                         SocketChannel sc = ((SocketChannel) k.channel());
                         if ((k.readyOps() & SelectionKey.OP_CONNECT) != 0) {
                             if (sc.finishConnect()) {
-                                zooKeeper.state = States.CONNECTED;
                                 lastHeard = now;
                                 lastSend = now;
                                 primeConnection(k);
@@ -809,10 +809,10 @@ class ClientCnxn {
     public ReplyHeader submitRequest(RequestHeader h, Record request,
             Record response,
             WatchRegistration watchRegistration)
-        throws InterruptedException 
+        throws InterruptedException
     {
         ReplyHeader r = new ReplyHeader();
-        Packet packet = 
+        Packet packet =
             queuePacket(h, r, request, response, null, null, null,
                     watchRegistration);
         synchronized (packet) {