[tor-dev] [Stegotorus] Fake bug, boost, DECLARE, etc
vmon
vmonmoonshine at gmail.com
Fri Aug 31 18:13:55 UTC 2012
Hello Zack,
I hope you have already settled down and your new home feels homey by now.
Frist let me start with this, that took me the longest (not) to "tackle":
> Sometimes they get
> reordered to an extent that seems incredible, e.g. block 60 arriving
> immediately after block 42 as in your example
After talking to Nick, exchanging emails on curl mailing list,
hacking the curl code and recompiling it, finally guess what was the
problem, ..., my terminal was censoring stderr and was selectively
printing the log_debug, hence only print recv 42 and recv 60 but nothing
in between. That was why everything was going smooth while I was
"losing" dozens of blocks every so often. When I redirect the stderr to
a file I got all packets in order. So we are good here.
> First: boost should not be used.
I'm using boost for recursively traversing the document root directory
of the http server in PayloadScraper. Collaterally, I used to its other
function, like existence of a file, because the damage was already done.
If you know another option that does the same (iterating through all
files in subdirs recursively) in a hassle-free way and is portable
to Windows, then I'm at your service to replace boost.
> Second: do not include the header <iostream>
Got rid of it.
> whenever you print an error message as a direct consequence of
> an I/O operation failing, include
Done.
> the problem you were having with the DECLARE macros?
This is the issue: http_steg and http_apache_steg they have a lot in
common. In c++ fashion, one just inherit http_apache_steg from http_steg
and re-write only those functions that are different. But using DECLARE
functions there are two problems:
1. You have to re-define all the functions even those that are exactly
the same, and I have few of these:
int
http_apache_steg_t::receive(struct evbuffer *dest)
{
return http_steg_t::receive(dest);
}
2. If I was to follow the procedure rigorously even #1 solution was
not possible, because it requires that http_steg is defined in a
anonymous namespace so I couldn't inherit another structure from it
in another file, so I had have http_steg not in its own namespace.
So your call, if it is OK, is OK, if not we can get rid of the DECLARE.
Cheers,
vmon
More information about the tor-dev
mailing list