diff options
author | 2015-12-22 15:51:22 +0100 | |
---|---|---|
committer | 2015-12-22 15:51:22 +0100 | |
commit | eee04b4ac5847f6101b9321e4513c4401e745a0a (patch) | |
tree | 12a6386007bd6681f3090b7808fb83df07e97b14 /src | |
parent | 1b238baa74d36f144581deee5f3a1834d1d445bb (diff) |
Fix Post JSON bug
Diffstat (limited to 'src')
-rw-r--r-- | src/rest-api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rest-api.c b/src/rest-api.c index c1a20f13..3d9ffeb7 100644 --- a/src/rest-api.c +++ b/src/rest-api.c @@ -367,6 +367,7 @@ PUBLIC int doRestApi(struct MHD_Connection *connection, AFB_session *session, co // allocate application POST processor handle to zero postHandle = calloc(1, sizeof (AFB_PostHandle)); postHandle->uid = postcount++; // build a UID for DEBUG + *con_cls = postHandle; // update context with posthandle // Let make sure we have the right encoding and a valid length encoding = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, MHD_HTTP_HEADER_CONTENT_TYPE); @@ -390,7 +391,6 @@ PUBLIC int doRestApi(struct MHD_Connection *connection, AFB_session *session, co postHandle->type = AFB_POST_FORM; postHandle->pp = MHD_create_post_processor (connection, MAX_POST_SIZE, doPostIterate, postHandle); postHandle->private= (void*)request; - *con_cls = postHandle; // update context with posthandle if (NULL == postHandle->pp) { fprintf(stderr,"OOPS: Internal error fail to allocate MHD_create_post_processor\n"); |