From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out.smtp-auth.no-ip.com (out.smtp-auth.no-ip.com [8.23.224.60]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 2487B77C83 for ; Wed, 23 Dec 2015 16:04:01 -0800 (PST) X-No-IP: carhart.net@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from carhart.net (unknown [99.52.200.227]) (Authenticated sender: carhart.net@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 5C6144015AD; Wed, 23 Dec 2015 16:04:12 -0800 (PST) Received: from carhart.net (localhost [127.0.0.1]) by carhart.net (8.13.8/8.13.8) with ESMTP id tBO04B0J029049; Wed, 23 Dec 2015 16:04:11 -0800 Received: from localhost (kevin@localhost) by carhart.net (8.13.8/8.13.8/Submit) with ESMTP id tBO04BOB029046; Wed, 23 Dec 2015 16:04:11 -0800 Date: Wed, 23 Dec 2015 16:04:11 -0800 (PST) From: Kevin Carhart To: Karl Dahlke cc: Edbrowse-dev@lists.the-brannons.com In-Reply-To: Message-ID: References: <20151122181357.eklhad@comcast.net> User-Agent: Alpine 2.03 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [Edbrowse-dev] Rebundle X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 00:04:01 -0000 Oops, sorry, I clobbered my first line in that message. You mentioned that the curl handle isn't initialized, so I added a curl_easy_init() at the top of httpConnect. So then would I also need to add a call to the cleanup at the bottom of httpConnect? Here's what I have for the native implementation of a javascript function. It currently succeeds in returning the response to javascript, but then edbrowse segfaults on quit. static JSBool fetchAsynchronous(JSContext * cx, unsigned int argc, jsval * vp) { JS::RootedString str(cx); JS::RootedString headers(cx); JS::RootedString payload(cx); JS::CallArgs args = JS::CallArgsFromVp(argc, vp); str = JS_ValueToString(cx, args[0]); char *curl_url = JS_c_str(str); headers = JS_ValueToString(cx, args[1]); char *curl_headers = JS_c_str(headers); // url, headers, payload payload = JS_ValueToString(cx, args[2]); char *post = JS_c_str(payload); char *javatext; if (httpConnect(curl_url,false,false)) { if(hcode == 200) { javatext = serverData; prepareForBrowse(javatext, serverDataLen); } } args.rval().set(STRING_TO_JSVAL(JS_NewStringCopyZ(cx, javatext))); }