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>
Fri, 12 Aug 2016 18:57:46 +0000 (14:57 -0400)
Tag messages as osrfResultPartial and osrfResultPartialComplete,
consistent with Perl.

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

index 9de5e0f..e7aae08 100644 (file)
@@ -489,7 +489,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));