Skip to content

Commit

Permalink
PubNub SDK v3.2.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed Sep 15, 2021
1 parent 149e536 commit 16794d3
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 24 deletions.
33 changes: 19 additions & 14 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: c-core
schema: 1
version: "3.1.0"
version: "3.2.0"
scm: github.com/pubnub/c-core
changelog:
- version: v3.2.0
date: 2021-09-15
changes:
- type: bug
text: "Error codes for missing subscribe timetoken."
- version: v3.1.0
date: 2021-06-14
changes:
Expand Down Expand Up @@ -545,7 +550,7 @@ supported-platforms:
sdks:
-
full-name: PubNub POSIX C SDK
short-name: C-Core
short-name: POSIX C
artifacts:
-
artifact-type: api-client
Expand Down Expand Up @@ -611,12 +616,12 @@ sdks:
- macOS 11.3.1
-
full-name: PubNub POSIX C++ SDK
short-name: C-Core
short-name: POSIX C++
artifacts:
-
artifact-type: api-client
language: C/C++
tier: 1
tier: 2
tags:
- Server
- Mobile
Expand Down Expand Up @@ -677,12 +682,12 @@ sdks:
- macOS 11.3.1
-
full-name: PubNub Windows C SDK
short-name: C-Core
short-name: Windows C
artifacts:
-
artifact-type: api-client
language: C
tier: 1
tier: 2
tags:
- Server
- Mobile
Expand Down Expand Up @@ -739,12 +744,12 @@ sdks:
- Windows 10 Enterprise
-
full-name: PubNub Windows C++ SDK
short-name: C-Core
short-name: Windows C++
artifacts:
-
artifact-type: api-client
language: C/C++
tier: 1
tier: 2
tags:
- Server
- Mobile
Expand Down Expand Up @@ -801,12 +806,12 @@ sdks:
- Windows 10 Enterprise
-
full-name: PubNub FreeRTOS SDK
short-name: C-Core
short-name: FreeRTOS
artifacts:
-
artifact-type: api-client
language: C
tier: 1
tier: 2
tags:
- Mobile
source-repository: https://github.com/pubnub/c-core
Expand Down Expand Up @@ -857,12 +862,12 @@ sdks:
- 150825
-
full-name: PubNub Qt SDK
short-name: C-Core
short-name: Qt
artifacts:
-
artifact-type: api-client
language: C
tier: 1
tier: 2
tags:
- Mobile
source-repository: https://github.com/pubnub/c-core
Expand Down Expand Up @@ -910,12 +915,12 @@ sdks:
- Qt5
-
full-name: PubNub Mbed SDK
short-name: C-Core
short-name: mBed
artifacts:
-
artifact-type: api-client
language: C
tier: 1
tier: 2
tags:
- Mobile
source-repository: https://os.mbed.com/users/sveljko/code/Pubnub_mbed2_sync/
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## [v3.1.0](https://github.com/pubnub/c-core/releases/tag/v3.1.0)
June 14 2021
## [v3.2.0](https://github.com/pubnub/c-core/releases/tag/v3.2.0)
September 15 2021

[Full Changelog](https://github.com/pubnub/c-core/compare/v3.0.0...v3.1.0)
[Full Changelog](https://github.com/pubnub/c-core/compare/v3.1.0...v3.2.0)

- Added PAMv3 Grant Token support.
- Error codes for missing subscribe timetoken.


10 changes: 5 additions & 5 deletions core/pbcc_subscribe_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ enum pubnub_res pbcc_parse_subscribe_v2_response(struct pbcc_context* p)
size_t len = titel.end - titel.start - 2;
if ((*titel.start != '"') || (titel.end[-1] != '"')) {
PUBNUB_LOG_ERROR("Time token in response is not a string\n");
return PNR_FORMAT_ERROR;
return PNR_SUB_TT_FORMAT_ERROR;
}
if (len >= sizeof p->timetoken) {
PUBNUB_LOG_ERROR(
"Time token in response, length %lu, longer than max %lu\n",
(unsigned long)len,
(unsigned long)(sizeof p->timetoken - 1));
return PNR_FORMAT_ERROR;
return PNR_SUB_TT_FORMAT_ERROR;
}

memcpy(p->timetoken, titel.start + 1, len);
Expand All @@ -145,21 +145,21 @@ enum pubnub_res pbcc_parse_subscribe_v2_response(struct pbcc_context* p)
else {
PUBNUB_LOG_ERROR(
"No timetoken value in subscribe V2 response found\n");
return PNR_FORMAT_ERROR;
return PNR_SUB_NO_TT_ERROR;
}
if (jonmpOK == pbjson_get_object_value(&found, "r", &titel)) {
p->region = strtol(titel.start, NULL, 0);
}
else {
PUBNUB_LOG_ERROR(
"No region value in subscribe V2 response found\n");
return PNR_FORMAT_ERROR;
return PNR_SUB_NO_REG_ERROR;
}
}
else {
PUBNUB_LOG_ERROR(
"No timetoken in subscribe V2 response found, error=%d\n", jpresult);
return PNR_FORMAT_ERROR;
return PNR_SUB_NO_TT_ERROR;
}

p->chan_ofs = p->chan_end = 0;
Expand Down
3 changes: 3 additions & 0 deletions core/pbntf_trans_outcome_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
PUBNUB_LOG_INFO("Context %p Transaction outcome: %d\n", M_pb_, M_pbrslt_); \
switch (M_pbrslt_) { \
case PNR_FORMAT_ERROR: \
case PNR_SUB_TT_FORMAT_ERROR: \
case PNR_SUB_NO_TT_ERROR: \
case PNR_SUB_NO_REG_ERROR: \
PUBNUB_LOG_WARNING("Context %p Resetting time token\n", M_pb_); \
M_pb_->core.timetoken[0] = '0'; \
M_pb_->core.timetoken[1] = '\0'; \
Expand Down
6 changes: 6 additions & 0 deletions core/pubnub_api_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ enum pubnub_res {
PNR_HTTP_ERROR,
/** Unexpected input in received JSON. */
PNR_FORMAT_ERROR,
/** Subscribe Timetoken not in expected format */
PNR_SUB_TT_FORMAT_ERROR,
/** No Timetoken in the subscribe response */
PNR_SUB_NO_TT_ERROR,
/** No Region in the subscribe response */
PNR_SUB_NO_REG_ERROR,
/** Request cancelled by user. */
PNR_CANCELLED,
/** Transaction started. Await the outcome. */
Expand Down
3 changes: 3 additions & 0 deletions core/pubnub_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ char const* pubnub_res_2_string(enum pubnub_res e)
case PNR_IO_ERROR: return "I/O (communication) error";
case PNR_HTTP_ERROR: return "HTTP error received from server";
case PNR_FORMAT_ERROR: return "Response format error";
case PNR_SUB_TT_FORMAT_ERROR: return "Subscribe Timetoken not in expected format";
case PNR_SUB_NO_TT_ERROR: return "No Timetoken in the subscribe response";
case PNR_SUB_NO_REG_ERROR: return "No Region in the subscribe response";
case PNR_CANCELLED: return "Pubnub API transaction cancelled";
case PNR_STARTED: return "Pubnub API transaction started";
case PNR_IN_PROGRESS: return "Pubnub API transaction already in progress";
Expand Down
2 changes: 1 addition & 1 deletion core/pubnub_version_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define INC_PUBNUB_VERSION_INTERNAL


#define PUBNUB_SDK_VERSION "3.1.0"
#define PUBNUB_SDK_VERSION "3.2.0"


#endif /* !defined INC_PUBNUB_VERSION_INTERNAL */

0 comments on commit 16794d3

Please sign in to comment.