edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] Rebundle
Date: Wed, 23 Dec 2015 16:01:40 -0800 (PST)	[thread overview]
Message-ID: <alpine.LRH.2.03.1512231541250.2850@carhart.net> (raw)
In-Reply-To: <alpine.LRH.2.03.1512231514340.2850@carhart.net>




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)));
}



  reply	other threads:[~2015-12-24  0:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22 23:13 Karl Dahlke
2015-12-23 23:17 ` Kevin Carhart
2015-12-24  0:01   ` Kevin Carhart [this message]
2015-12-24  0:04     ` Kevin Carhart
2015-12-24  0:17       ` Karl Dahlke
2015-12-24  0:46         ` Kevin Carhart
2015-12-25 15:10       ` Karl Dahlke
2015-12-26  8:44         ` [Edbrowse-dev] Rebundle / One program # processes Kevin Carhart
2015-12-26 15:56           ` Karl Dahlke
2015-12-27  7:54             ` Adam Thompson
2015-12-27  9:18               ` [Edbrowse-dev] response headers and body? Kevin Carhart
2015-12-27 13:38                 ` Karl Dahlke
2015-12-27 21:03                   ` Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.03.1512231541250.2850@carhart.net \
    --to=kevin@carhart.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).