C max_chunk_size server bits continued
authorBill Erickson <berick@esilibrary.com>
Fri, 28 Feb 2014 20:07:48 +0000 (15:07 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 21 Jul 2016 15:43:35 +0000 (11:43 -0400)
Tag messages as osrfResultPartial and osrfResultPartialComplete,
consistent with Perl.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
src/libopensrf/osrf_message.c

index 3681dfa..bdb4ff7 100644 (file)
@@ -461,7 +461,13 @@ jsonObject* osrfMessageToJSON( const osrfMessage* msg ) {
                case RESULT:
                        jsonObjectSetKey(json, "type", jsonNewObject("RESULT"));
                        payload = jsonNewObject(NULL);
-                       jsonObjectSetClass(payload,"osrfResult");
+            char* cname = "osrfResult";
+            if (msg->status_code == OSRF_STATUS_PARTIAL) {
+                cname = "osrfResultPartial";
+            } else if (msg->status_code == OSRF_STATUS_NOCONTENT) {
+                cname = "osrfResultPartialComplete";
+            }
+                       jsonObjectSetClass(payload, cname);
                        jsonObjectSetKey(payload, "status", jsonNewObject(msg->status_text));
                        snprintf(sc, sizeof(sc), "%d", msg->status_code);
                        jsonObjectSetKey(payload, "statusCode", jsonNewObject(sc));