IRC Log Viewer » #firebreath » 2013-02-14

IRC Nick Time (GMT-7) Message
jack316 00:02 Hi!
I am new to this chat section and also in developing Plugins and extensions
Wanna know what prerequisite needs to be done before starting coding on extensions?
I will be using C++ as a programming language.
nirvdrum 07:02 Hey, you guys are all C developers. It's been a while . . . what's the best way to split a const char* by a string, not a set a of chars? Basically I have a response body and want to drop out the MIME headers, which are delimited from the body by "\r\n\r\n"
taxilian 08:02 nirvdrum: I bet there is a split in boost that will do that
nirvdrum 08:02 This is for a non-FB project. I was hoping to avoid pulling in boost.
taxilian 08:02 ahh
nirvdrum 08:02 I ended up just writing a for loop that offsets the pointer after "\r\n\r\n". Not the prettiest thing, but since it's const it should be safe.
taxilian 08:02 hehe. probably will work
nirvdrum 08:02 My project du jour is a plugin for Apache Traffic Server.
taxilian 08:02 not familiar with that noe
nirvdrum 08:02 It's basically a caching proxy server.
taxilian 08:02 how does it differ from squid?
nirvdrum 08:02 Far easier to configure, seems better maintained, better support, and it looks like a richer plugin mechanism.
taxilian 08:02 cool
nirvdrum 08:02 I was using squid prior to this and one thing I could never get working was configuring how long to cache items for.
taxilian 08:02 might have to look at sometime
is it java or native?
nirvdrum 08:02 ATS has a pretty active IRC channel. They've been really helpful.
Native. Thus my plugin needing to be done in C/C++.
taxilian 08:02 oh. right. :-P
it's early =]
nirvdrum 08:02 I think the project was originally a tool Yahoo built.
taxilian 08:02 yeah, looks like it
nirvdrum 08:02 And then donated to the ASF.
Squid has been pumping out versions, but I could never get help with anything. And their config is rather complex.
taxilian 08:02 heh. yeah, squid is a bit of a beast, I've noticed
nirvdrum 08:02 What's kinda cools is ATS can dump out to the squid log format in case you have any tools that process squid logs.
taxilian 08:02 huh. clever
I wonder how it compares to nginx as a reverse proxy
nirvdrum 08:02 For Mogotest, I wanted to cache content to avoid hammering servers, but a lot of people screw up their cache headers and expect us to fix it. So, they'll update a file but we'd still pull in the old cached one, so we'd test against their old site, and they'd be upset.
So, I wanted to cache, but cap it at 5 min., no matter what the cache header says.
I couldn't get squid to do that.
taxilian 08:02 ahh
nirvdrum 08:02 A bit of an odd use case, but ATS handles it.
Another nicety is with that that short a cache, everything basically fits in memory, so no hitting that really slow EC2 disk.
Now I need to be able to remap URLs at times, thus the plugin.
taxilian 08:02 EC2 is particularly slow?
nirvdrum 08:02 Their disk access isn't great. All depends on what class of machine you have.
This is an m1.small, so the disk I/O is not good.
taxilian 08:02 never really looked into the EC2 stuff in depth
haven't yet decided to entrust anything to them, so… =]
nirvdrum 08:02 I think I'd rather move to dedicated hardware, but it's really convenient being able to bring up a staging server with a couple commands.
taxilian 08:02 yeah, I can definitely see that =]
nirvdrum 08:02 Hetzner looks like it'd be really cost effective.
taxilian 08:02 ?
nirvdrum 08:02 I was looking at doing a split cluster approach, but I'd need to get OpenVPN or something set up.
taxilian 08:02 do they even have services in the US? it looks like this is a german company
nirvdrum 08:02 They are.
And I don't think they have anything in the US.
So, you'd have to compensate for latency.
But I could push non-time sensitive stuff out there.
They're very highly rated.
16 GB or 32 GB RAM on EC2 costs a fortune.
taxilian 08:02 huh
nirvdrum 08:02 And you're working with Xen configured for basically Pentium III Xeon.
Who do you host with?
taxilian 08:02 well, I used to host with
these days I host with the little box sitting up on the corner of my desk
nirvdrum 08:02 Ahh. Heh.
taxilian 09:02 I have a vmware vsphere server that has a bunch of virtualmachines on it runs on one; runs on another
magicken 09:02 hello taxillian! Pls help me to include a bitmap resource in the project :-)
I tried but I failed
I use vs 2010
taxilian 09:02 what did you try?
magicken 09:02 I write into firebreathwin.rc located in my build\myproject\gen LOGO BITMAP "C:/logo.bmp"
taxilian 09:02 that file is generated automatically
modifying anything in the build dir will get overwritten
you'll probably have to customize the .rc file, so copy the one from gen_templates/ into the root of your project directory
and change that one
then rerun the prep script
magicken 09:02 ok, but if i rerun prep script my settings for the solution will change...
if i want to use the default .rc file that is generated?
taxilian 10:02 if you want to use the default .rc file you can't add resources
you'll have to customize the .rc file, which means providing your own
magicken 10:02 Ok so the steps are: copy firebreathwin.rc in root of src project; run prep script.
It's all?
taxilian 10:02 well, and change the .rc file after copying it....
magicken 10:02 Ok thank you very much
Every time I want to add a resource I must rerun prep script?
taxilian 10:02 yes
magicken 10:02 Ok, thank you very much. I love your project
taxilian 10:02 please contribute back in whatever way you are able; there are plenty of bugs to fix, docs to update, etc =]
Grimshaw 11:02 jshanab: are you there brother? : )
jshanab 11:02 Grimshaw. Here
taxilian 11:02 heh. he left already
jshanab 11:02 If it is important, he'll be back
taxilian 11:02 yeah
kylehuff 14:02 I am using boost::optional, and it keeps complaining about no matching function call. I followed the example in FBTestPluginAPI.cpp in the examples directory and I can't figure out what I'm doing wrong..
my declaration is: FB::variant verify(const std::string& data, const boost::optional<std::string>& plaintext);, but when if I have a call to verify(dataObj); compilation fails
I'm retarded, nevermind. I forgot to change from "const FB::variant verify(..." to "const boost::optional<FB::variant> verify(..." in my declaration.
kylehuff 14:02 spoke too soon. that doesn't resolve my issue in the least. lol
taxilian 14:02 kylehuff: you can't not provide the argument from C++
it only makes it optional when registering it with jsapi
kylehuff 14:02 taxilian: ahh! that makes sense. I should have caught that. thanks
taxilian 14:02 you can pass in boost::optional<std::string>() to give it a value that way, though