IRC Log Viewer » #firebreath » 2011-11-15

IRC Nick Time (GMT-7) Message
Sudi 10:11 good morning guys!!
taxilian 10:11 'morning
linearray 11:11 Risking to bore you with my constant bickering about asio, I present to you proof that the asio guy has the best ganja on the planet:
boost::asio::read_until(socket,buf,str); <-- this reads from the socket until it encounters "str" _or a completely arbitrary number of bytes more_
taxilian 11:11 ganja?
linearray 11:11 weed
drugs
taxilian 11:11 and the docs don't say it should read any more than the string
ahh
sorry, not up with the lingo ;-)
linearray 11:11 :)
it is mentioned in the docs, but it makes the whole function a bit pointless, if I have to wrap it on my own to put all the trailing data in the buffer it's supposed to go to.
jshanab_wcw 12:11 It works well it gets the headers for a web page and a little more maybe that just gets picked up the next call to get content. But i switched to curl because the StreamBuffers they use are really slow and asio is peaky.
Dan8464 12:11 question - cmake doesn't seem to download CURL automatically / something isn't right. I get an error of: -- Could NOT find CURL (missing: CURL_INCLUDE_DIR) ... I tried manually setting an env variable of CURL_INCLUDE_DIR= to where the curl includes are, but that didn't seem to have an impact. Is there something I'm missing/doing wrong?
taxilian 12:11 Dan8464: what platform are you on?
Dan8464 12:11 win7 x64
taxilian 12:11 oh… Could NOT find CURL is not actually an error in this case
that just means it didn't find curl preinstalled
it's an error message from a tool that looks for a preinstalled library for curl
when that fails it uses a different method
Dan8464 12:11 ahh
I thought it may have something to do with the compiler error I get: #include "log4cplus/config/defines.hxx"
that file doesnt exist
taxilian 12:11 that should be fixed; you probably just need to update
and rerun the prep script
Dan8464 12:11 update to a newer version of the firebreath library?
(I just ran the prep script)
taxilian 12:11 update to a newer version of the firebreath framework, yes
the latest 1.6 is what I recommend using
Dan8464 12:11 that's what I'm using - firebreath-FireBreath-dc5bfc6
FireBreathBot 12:11 dc5bfc6 by doug mansell: FIREBREATH-137: fix log4cplus cmakelists.txt on non-apple pl http://goo.gl/3UU24
taxilian 12:11 hmm; that should have the fix
Dan8464 12:11 err, whoops. I'm using the one right before that.
:) my bad
taxilian 12:11 that would be why =]
that commit is the fix itself =]
Dan8464 12:11 glad to see this is such an active project!
taxilian 12:11 honestly I really recommend you check it out from git
there is always a stable branch; development occurs on master
when the development stops being bugfixes (aka stops being stable) master diverges from the stable branch
so firebreath-1.6 will always be stable
until support for 1.6 is dropped in favor of the next version
which isn't likely in the next couple of months, I don't think
we're kinda in bugfix lockdown until I have a bit more time or something major comes up
Dan8464 13:11 will do. I just got git, I've been an SVN & TFS guy for the longest time
are you the main contributor to it?
taxilian 13:11 yes
I should probably release a 1.6.1 to fix the log4cplus issues, I guess
Dan8464_ 13:11 taxilian: do you do freelance work?
taxilian 13:11 I have been known to do freelance work; right now I'm completely swamped
my usual policy is "never say no, but raise the price until it's worth it", but I'm so busy right now I don't know that there is a price it would become worth it
Dan8464_ 13:11 do you know anyone thats famaliar with this project that would? the work I need done is stuff that could be contributed to the main project (stuff to do with handling POST requests/http stuff)
no worries, just thought I would ask
taxilian 13:11 hmm. there are several in this room that could probably handle that type of work, but I don't know if they are available for freelance or not
if one of them says they are interested I can give you an honest assessment of how well they'd do in a PM
the best would be Georg Fritzsche, though; I don't know what his schedule is like because he hasn't been active in development for almost a year, but he knows the project really well even so.
Dan8464_ 13:11 I see, does he frequent this room?
taxilian 13:11 not in a long time
he wrote the original core implementation of JSAPIAuto, though
most of the template magic in FireBreath is his, though I've extended it
Dan8464_ 13:11 I see
I'm going to attempt to hack in support for handling POST and GET data :)
taxilian 13:11 cool =]
Dan8464_ 13:11 haha, not if you knew how long it's been since I wrote anything outside of C# :P
taxilian 13:11 there is support in there for *uploading* files
just not for receiving uploaded files
Dan8464_ 13:11 right. is there anything in there that parses get or post data?
taxilian 13:11 get data, yes
!findfile URI.h
FireBreathBot 13:11 Found 1 matching file(s) in the master branch. First 1 are:
src/ScriptingCore/URI.h http://goo.gl/NkErt
taxilian 13:11 but not multipart POST
tpaul 14:11 Does anyone know of a good solution to get an image from the browser into my plugin as a bitmap? I think I'm going to have to pass the image to my FB plugin as base64, decode it, then load it into memory. Just wondering if anyone has tackled this before.
taxilian 15:11 missed him
linearray 15:11 and what is the answer?
taxilian 15:11 well, partially depends on what format the image in the browser is
is this a bytearray?
or just an image tag?
if it's a bytearray, then… well, yeah, base64 is probably the only real option
or I suppose you could make a XMLHttpRequest to an embedded web browser and send it that way
web server, I mean
linearray 15:11 wicked
taxilian 15:11 I do wonder if you could use web sockets to talk to a plugin as a method for sending binary data
linearray 15:11 btw. do you have a definite solution for getting a full filename out of a javascript file open dialog? because if that just doesn't work I will have to resort to something like 'uploading' the file to my plugin
taxilian 15:11 no, I don't
I do have an example of opening a file dialog with the plugin, however
linearray 15:11 platform-independent?
taxilian 15:11 only for mac and windows
linearray 15:11 close enough :) can you share it?
taxilian 15:11 could probably be refactored into a platform independent library
let me find out
it may not be the exact dialogs you need, but probably close enough
also, I ask that if I do share it and you use it you work it into a firebreath library so it can go back into the project
linearray 15:11 ok
agreed
taxilian 15:11 you're lucky my boss is nice and likes firebreath :-P
give me a few to package it in a gist
it may not have exactly the dialogs you need, but should be close enough that you can get it the rest of the way there
https://gist.github.com/1368648
this actually has code mostly for choosing a directory, not a file
but I think the windows code has the guts for a file dialog as well, and the mac should be similar enough to the dir one that you should be able to get it to work
it at least gets you 75% of the way there
linearray 15:11 nice, I'll have a look
taxilian 15:11 it's also an excellent example of how you can create a cross platform abstraction without using #ifdefs
linearray 16:11 yeah, I think we have a few by now
WebView and SystemHelpers come to mind
taxilian 16:11 you might be the one to whom I explained the pattern I use here
ahh, yes
that's true
linearray 16:11 yep that was me
taxilian 16:11 I remember conversations but I can never remember who I was talking with =]
linearray 16:11 hehe I know that feeling
I'll also see what to make of this HTML5 File API
tpaul 16:11 the irc logs rock, and I agree that an XHR request to an embedded server is pretty wicked :)
taxilian 17:11 lol
yeah; one of these days we should get a better IRC log viewer, though. iain started this and did a great job with it, but he disappeared before finishing it
tpaul 17:11 I was impressed, this embedded irc is a really nice feature too I would probably not be irc'ing otherwise
taxilian 17:11 and it actually only took me about 20 minutes to set up
tpaul 17:11 Is it safe to rely on m_host->getDOMWindow()->getLocation()? If for instance, I wanted to limit the use of a plugin to a list of domains, or only https...
taxilian 17:11 well, yes and no
it is safe in that as far as I know there is no way to spoof that
but it is only as safe as long as nothing tricks the browser
DNS spoofing will defeat that handily, for example
and even if you are in a "safe" domain, there is the chance of an XSS attack getting code onto your page that uses the plugin
linearray 17:11 this is asked so often it should be in tips and tricks
taxilian 17:11 good idea =]
feel free :-P
(you should know by now what my response to comments like that are ;-])
tpaul 17:11 I figured a man in the middle scenario is unavoidable, xss is something to consider, I'll add it to the Tops and tricks since I'm there anyways :)
taxilian 17:11 man in the middle is actually possible to avoid if you're using HTTPS and have your own controlled openssl
but it's tricky
you basically have to tell openssl to only trust a specified root CA certificate (that you provide and that signed your cert)
then you use an embedded web browser for the interface and only allow calls to dangerous APIs from that embedded web browser (or other source that runs code you got across a trusted connection)
linearray 17:11 my excuse is i'm on ipad right now!
taxilian 17:11 hehe
that's okay, sounds like tpaul has it covered
tpaul 17:11 Oh sorry linearray, I didn't notice you responded
taxilian 17:11 no worries, we don't care who puts things on the wiki, as long as the documentation is updated
generally I figure that I do most of the code fixes, so I leave documentation up to others
though I do monitor the changes for accuracy of course
tpaul 17:11 Have you ever heard of the Podcast FLOSS weekly? I'd love to hear about the inter-workings of FB sometime, they ask that the project leaders contact them or Randal Schwartz([email protected]) to more precise. That is, if you have any interest...
taxilian 17:11 sounds interesting; I have actually done some videos on how firebreath works (on the website)
tpaul 17:11 By "inter-workings" I guess mean
like governance, and changes and contributions and such
Thanks for the help!