Mobrovac has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312022

Change subject: Update restbase to dab713a
......................................................................

Update restbase to dab713a

List of changes:
dab713a Look at the rootReq headers (#678)
xxxxxxx Update node module dependencies

Change-Id: I85be21d1ec8474c5253817d4205e04797a16105d
---
M node_modules/content-type/package.json
M node_modules/hyperswitch/node_modules/json-stable-stringify/package.json
M node_modules/hyperswitch/node_modules/swagger-ui/package.json
M node_modules/json-stable-stringify/package.json
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
M 
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
M 
node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
M 
node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
M restbase
9 files changed, 62 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/restbase/deploy 
refs/changes/22/312022/1

diff --git a/node_modules/content-type/package.json 
b/node_modules/content-type/package.json
index d228479..862f822 100644
--- a/node_modules/content-type/package.json
+++ b/node_modules/content-type/package.json
@@ -44,7 +44,7 @@
   },
   "homepage": "https://github.com/jshttp/content-type#readme";,
   "_id": "content-type@1.0.1",
-  "_shasum": "9a9041760a97de2569558f8f0f6b6dc326e5ec0e",
+  "_shasum": "9b739ded961413617cbc1901e7b58931816eff21",
   "_from": "git+https://github.com/wikimedia/content-type.git#master";,
   "_resolved": 
"git+https://github.com/wikimedia/content-type.git#47b2632d0a2ee79a7d67268e2f6621becd95d05b";
 }
diff --git 
a/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json 
b/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json
index 6061d64..786359d 100644
--- a/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json
+++ b/node_modules/hyperswitch/node_modules/json-stable-stringify/package.json
@@ -50,7 +50,7 @@
     "url": "https://github.com/substack/json-stable-stringify/issues";
   },
   "_id": "json-stable-stringify@1.0.0",
-  "_shasum": "7ee90030e265a7662594c7592ed932602711172b",
+  "_shasum": "885db740350388dc54d5f08dc7d5185a3c729a5d",
   "_from": "git+https://github.com/wikimedia/json-stable-stringify.git#master";,
   "_resolved": 
"git+https://github.com/wikimedia/json-stable-stringify.git#c05178e4dfc3834017f017732934c1c52ba3dd8f";
 }
diff --git a/node_modules/hyperswitch/node_modules/swagger-ui/package.json 
b/node_modules/hyperswitch/node_modules/swagger-ui/package.json
index 91f3ebb..2232805 100644
--- a/node_modules/hyperswitch/node_modules/swagger-ui/package.json
+++ b/node_modules/hyperswitch/node_modules/swagger-ui/package.json
@@ -70,7 +70,7 @@
     "url": "https://github.com/swagger-api/swagger-ui/issues";
   },
   "_id": "swagger-ui@2.2.2",
-  "_shasum": "450722cad4fe733f7ae76f9521ecd851b785186e",
+  "_shasum": "f7ff7333ffabe4df71047fc8d1b80f9388b80301",
   "_from": "git+https://github.com/wikimedia/swagger-ui.git#master";,
   "_resolved": 
"git+https://github.com/wikimedia/swagger-ui.git#f89ca3d27111bde918492db6d7eaca37302407f6";
 }
diff --git a/node_modules/json-stable-stringify/package.json 
b/node_modules/json-stable-stringify/package.json
index 0995246..2d947ad 100644
--- a/node_modules/json-stable-stringify/package.json
+++ b/node_modules/json-stable-stringify/package.json
@@ -50,7 +50,7 @@
     "url": "https://github.com/substack/json-stable-stringify/issues";
   },
   "_id": "json-stable-stringify@1.0.0",
-  "_shasum": "e97df1aa1ab9c178d38a71804513af671715369c",
+  "_shasum": "32d761d9d07255c95b116f8375217265d4ff6435",
   "_from": "git+https://github.com/wikimedia/json-stable-stringify.git#master";,
   "_resolved": 
"git+https://github.com/wikimedia/json-stable-stringify.git#c05178e4dfc3834017f017732934c1c52ba3dd8f";
 }
diff --git 
a/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
 
b/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
index 77abbc2..8b1d8bc 100644
--- 
a/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
+++ 
b/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/lib/streams.js
@@ -163,14 +163,19 @@
 Parser.prototype.parseBody = function (frameInfo, item) {
   frameInfo.isStreaming = frameInfo.byRow && item.header.opcode === 
types.opcodes.result;
   if (!this.handleFrameBuffers(frameInfo, item)) {
+    // Frame isn't complete and we are not streaming the frame
     return;
   }
   var reader = new FrameReader(item.header, item.chunk, item.offset);
-  var originalOffset = reader.offset;
-  try {
-    frameInfo.flagsInfo = reader.readFlagsInfo();
-  } catch (e) {
-    return this.handleParsingError(e, frameInfo, reader, originalOffset);
+  // Check that flags have not been parsed yet for this frame
+  if (frameInfo.flagsInfo === undefined) {
+    var originalOffset = reader.offset;
+    try {
+      frameInfo.flagsInfo = reader.readFlagsInfo();
+    }
+    catch (e) {
+      return this.handleParsingError(e, frameInfo, reader, originalOffset);
+    }
   }
 
   //All the body for most operations is already buffered at this stage
@@ -280,46 +285,52 @@
  * @param {FrameReader} reader
  */
 Parser.prototype.parseResult = function (frameInfo, reader) {
+  var result;
+  // As we might be streaming and the frame buffer might not be complete,
+  // read the metadata and different types of result values in a try-catch.
+  // Store the reader position
   var originalOffset = reader.offset;
   try {
     if (!frameInfo.meta) {
       frameInfo.kind = reader.readInt();
-      if (frameInfo.kind === types.resultKind.prepared) {
-        frameInfo.preparedId = utils.copyBuffer(reader.readShortBytes());
-      }
-      else if (frameInfo.kind === types.resultKind.setKeyspace) {
-        frameInfo.keyspace = reader.readString();
-      }
-      if (frameInfo.kind === types.resultKind.rows ||
-          frameInfo.kind === types.resultKind.prepared) {
-        frameInfo.meta = reader.readMetadata(frameInfo.kind);
+      // Spec 4.2.5
+      switch (frameInfo.kind) {
+        case types.resultKind.voidResult:
+          result = { header: frameInfo.header, flags: frameInfo.flagsInfo };
+          break;
+        case types.resultKind.rows:
+          // Parse the rows metadata, the rest of the response is going to be 
parsed afterwards
+          frameInfo.meta = reader.readMetadata(frameInfo.kind);
+          break;
+        case types.resultKind.setKeyspace:
+          result = { header: frameInfo.header, keyspaceSet: 
reader.readString(), flags: frameInfo.flagsInfo };
+          break;
+        case types.resultKind.prepared:
+          var preparedId = utils.copyBuffer(reader.readShortBytes());
+          frameInfo.meta = reader.readMetadata(frameInfo.kind);
+          result = { header: frameInfo.header, id: preparedId, meta: 
frameInfo.meta, flags: frameInfo.flagsInfo };
+          break;
+        case types.resultKind.schemaChange:
+          result = { header: frameInfo.header, schemaChange: 
reader.parseSchemaChange(), flags: frameInfo.flagsInfo };
+          break;
+        default:
+          //noinspection ExceptionCaughtLocallyJS
+          throw errors.DriverInternalError('Unexpected result kind: ' + 
frameInfo.kind);
       }
     }
   }
   catch (e) {
     return this.handleParsingError(e, frameInfo, reader, originalOffset);
   }
-  switch (frameInfo.kind) {
-    case types.resultKind.setKeyspace:
-      return this.push({ header: frameInfo.header, keyspaceSet: 
frameInfo.keyspace});
-    case types.resultKind.voidResult:
-      return this.push({ header: frameInfo.header, id: frameInfo.preparedId, 
flags: frameInfo.flagsInfo});
-    case types.resultKind.schemaChange:
-      //it contains additional info that it is not parsed
-      if (frameInfo.emitted) {
-        return;
-      }
-      frameInfo.emitted = true;
-      return this.push({ header: frameInfo.header, schemaChange: 
reader.parseSchemaChange() });
-    case types.resultKind.prepared:
-      //it contains result metadata that it is not parsed
-      if (frameInfo.emitted) {
-        return;
-      }
-      frameInfo.emitted = true;
-      return this.push({ header: frameInfo.header, id: frameInfo.preparedId, 
meta: frameInfo.meta, flags: frameInfo.flagsInfo});
+  if (result) {
+    if (frameInfo.emitted) {
+      // It may contain additional metadata and info that it's not being parsed
+      return;
+    }
+    frameInfo.emitted = true;
+    return this.push(result);
   }
-  //it contains rows
+  // Its a `Rows` result
   if (reader.remainingLength() > 0) {
     this.parseRows(frameInfo, reader);
   }
@@ -334,7 +345,7 @@
     //No more processing on this frame
     return;
   }
-  if (typeof frameInfo.rowLength === 'undefined') {
+  if (frameInfo.rowLength === undefined) {
     try {
       frameInfo.rowLength = reader.readInt();
     }
@@ -429,6 +440,7 @@
     return this.bufferResultCell(frameInfo, reader, originalOffset, rowIndex, 
e.expectedLength);
   }
   frameInfo.parsingError = true;
+  frameInfo.cellBuffer = null;
   this.push({ header: frameInfo.header, error: e });
 };
 
diff --git 
a/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
 
b/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
index bf861cc..417345b 100644
--- 
a/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
+++ 
b/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cassandra-driver",
-  "version": "3.1.3",
+  "version": "3.1.4",
   "description": "DataStax Node.js Driver for Apache Cassandra",
   "author": {
     "name": "DataStax"
@@ -42,10 +42,10 @@
   "engines": {
     "node": ">=0.10.0"
   },
-  "gitHead": "884535fcc50539db786712fda85d6b97c40909c6",
+  "gitHead": "6627216a2472272de7b7982e9a7d6d17d43e5088",
   "homepage": "https://github.com/datastax/nodejs-driver#readme";,
-  "_id": "cassandra-driver@3.1.3",
-  "_shasum": "86f7cbea39e0627c605f94806671ea0fb361c8a4",
+  "_id": "cassandra-driver@3.1.4",
+  "_shasum": "76f2608f50798838e37a0df2737616f4d4a66908",
   "_from": "cassandra-driver@>=3.1.1 <4.0.0",
   "_npmVersion": "3.10.5",
   "_nodeVersion": "4.4.0",
@@ -60,13 +60,13 @@
     }
   ],
   "dist": {
-    "shasum": "86f7cbea39e0627c605f94806671ea0fb361c8a4",
-    "tarball": 
"https://registry.npmjs.org/cassandra-driver/-/cassandra-driver-3.1.3.tgz";
+    "shasum": "76f2608f50798838e37a0df2737616f4d4a66908",
+    "tarball": 
"https://registry.npmjs.org/cassandra-driver/-/cassandra-driver-3.1.4.tgz";
   },
   "_npmOperationalInternal": {
     "host": "packages-16-east.internal.npmjs.com",
-    "tmp": "tmp/cassandra-driver-3.1.3.tgz_1472655504776_0.046477287309244275"
+    "tmp": "tmp/cassandra-driver-3.1.4.tgz_1474470854300_0.7406644942238927"
   },
   "directories": {},
-  "_resolved": 
"https://registry.npmjs.org/cassandra-driver/-/cassandra-driver-3.1.3.tgz";
+  "_resolved": 
"https://registry.npmjs.org/cassandra-driver/-/cassandra-driver-3.1.4.tgz";
 }
diff --git 
a/node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
 
b/node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
index 6061d64..786359d 100644
--- 
a/node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
+++ 
b/node_modules/restbase-mod-table-cassandra/node_modules/json-stable-stringify/package.json
@@ -50,7 +50,7 @@
     "url": "https://github.com/substack/json-stable-stringify/issues";
   },
   "_id": "json-stable-stringify@1.0.0",
-  "_shasum": "7ee90030e265a7662594c7592ed932602711172b",
+  "_shasum": "885db740350388dc54d5f08dc7d5185a3c729a5d",
   "_from": "git+https://github.com/wikimedia/json-stable-stringify.git#master";,
   "_resolved": 
"git+https://github.com/wikimedia/json-stable-stringify.git#c05178e4dfc3834017f017732934c1c52ba3dd8f";
 }
diff --git 
a/node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
 
b/node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
index 53fbd7e..5c473a8 100644
--- 
a/node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
+++ 
b/node_modules/service-runner/node_modules/limitation/node_modules/kad/package.json
@@ -75,7 +75,7 @@
   },
   "homepage": "https://github.com/kadtools/kad#readme";,
   "_id": "kad@1.3.6",
-  "_shasum": "21ff351571771f525e733404bb83e2bd55f81463",
+  "_shasum": "843d0cfa501a1f3c1731f06503d8d879fc14f7fe",
   "_from": "git+https://github.com/gwicke/kad.git#master";,
   "_resolved": 
"git+https://github.com/gwicke/kad.git#f35971036f43814043245da82b12d035b7bbfd16";
 }
diff --git a/restbase b/restbase
index a107c78..dab713a 160000
--- a/restbase
+++ b/restbase
@@ -1 +1 @@
-Subproject commit a107c78dae32a7d23dd095410756e1bc7d97186e
+Subproject commit dab713a86dc190a40120f362ce960e8ddede4111

-- 
To view, visit https://gerrit.wikimedia.org/r/312022
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85be21d1ec8474c5253817d4205e04797a16105d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/restbase/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <mobro...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to