X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=plugins%2Fsamples%2FSamplePost.c;h=e419be4510ffc2b494851b0e94ec7b996f8a2c46;hb=f1a75365067fb89dd293aa2c8e003c3b041a3c9a;hp=9828349a4dbe4a6d70a2e00ade99c93c6f9ef942;hpb=b2247ca634420ed0d5ecc1743834ea4e0666aa2a;p=src%2Fapp-framework-binder.git diff --git a/plugins/samples/SamplePost.c b/plugins/samples/SamplePost.c index 9828349a..e419be45 100644 --- a/plugins/samples/SamplePost.c +++ b/plugins/samples/SamplePost.c @@ -47,14 +47,10 @@ STATIC json_object* UploadAppli (AFB_request *request, AFB_PostItem *item) { // This is called after PostForm and then after DonePostForm if (item == NULL) { - AFB_PostCtx *postFileCtx = getPostContext(request); - if (postFileCtx != NULL) { - - // Do something intelligent here to install application - - postFileCtx->errcode = MHD_HTTP_OK; // or error is something went wrong; - postFileCtx->jresp = jsonNewMessage(AFB_SUCCESS,"UploadFile Post Appli=%s done", getPostPath (request)); - } + // Do something intelligent here to install application + request->errcode = MHD_HTTP_OK; // or error is something went wrong; + request->jresp = jsonNewMessage(AFB_SUCCESS,"UploadFile Post Appli=%s done", getPostPath (request)); + // Note: should not return here in order getPostedFile to clear Post resources. } // upload multi iteration logic is handle by getPostedFile