@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> could you please make some comments on my make_insertquery function? http://rafb.net/paste/results/yyk8rK84.html Is it a good way to append to the string with my append function
<1> Well, the function itself looks ok, but are you sure that you have enough space in the destination?
<2> nirjovich: also, you do you really want to p*** the structure by value and not by reference?
<0> wilx: the names_sz and values_sz is calculated to be large enough to contain all data. And the query string is also malloced to the right size. Or am I missing something?
<0> lindi-: Well, the structure is so small, so I don't mind that little overhead of copying it. Also the code is slightly cleaner, by removing defererencing stuff.
<0> maybe thats a bad decision too
<0> ?
<2> nirjovich: yes it's small so maybe it's just a style issue :)
<3> not much clarity difference between r.count and r->count
<0> true. Guess it's just style
<0> apart from that. Is the function ok? Am I right that the space will be enough for the concatenation?
<3> you might want to comment why the +2 and +4 are added to size.
<2> and + 26 too
<4> append is a strcpy clone?
<3> but do you allocate memory for \0?
<3> domen, strcat



<2> yes he does but it's not obvious
<2> 25 + 1
<4> Auris: code looks like strcpy to me. just returned value is different
<3> lindi-, with names_sz andd values_sz.
<3> domen, ach, true. :-)
<3> bad function name.
<0> ok, +2 and +4 is for the ':s and commas. and 25 + 1 is for the "INSERT ..." string
<3> appending is achieved by using the returned address as dest for next cpy.
<0> what should I name the function?
<0> strcat is bad since it need to calculate the end for every call
<4> strcat_rend :-)
<3> I don't know. some name their variants strcat -> Strcat.
<3> we've all seen xmalloc.
<0> whats wrong with append ? :)
<3> it does not append.
<3> well, it does, but it also ***umes that dest string is empty.
<0> ok
<0> what does an xmalloc function usually do that malloc doesnt?
<3> I guess it wraps malloc and dies if malloc returns NULL.
<3> I wonder how much faster would it be to skip building of names and values and just create query with too loops.
<3> too=two
<0> you think that would be faster?
<3> at least it skips a malloc and two frees :-)
<0> hmm, true.
<3> and 2 strlens.
<1> You should use facilities that your DBs client library provides.
<1> Like placeholders and SQL statement preparation etc.
<3> and the sprintf.
<0> two loops is much better, I thought wrongly that that would iterate through a whole record two times, but its only two different arrays of strings
<0> I'll change it to two loops. And I'll chech the DB client library, and all other points you gave me. Thanks for the help!
<0> s/chech/check/
<3> backup the working version first ;-)
<0> sure :)
<0> wilx_: You know if mysql has any of those functions?
<3> odbc has at least. but I don't think you could (or would want to) use it to build generic queries with any number of variables.
<0> ok
<3> but the whole point it is to prepare and then execute multiple times. way faster than doing it like your doing there.
<3> -it
<3> your=you'are
<3> thank god I'm not coding.
<0> hehe
<0> how does it prepare? what does it execute multiple times?
<3> statements.
<3> like your insert there.
<0> but, how is my way different? It only prepares the string
<3> statements have to be parsed and planned and when you prepare them, you do that. then when you execute it multiple times for different values, you dont need to parse and plan for every single insert.
<0> aah, i see
<3> you wouldn't want to run C programs by having to compile them every time you run them.
<3> so you compile them once. and execute that multiple times.
<0> It would be something more like a string like "INSERT into %s (%s, %s) VALUES('%s', %s);" ?
<3> yep. although I think you can't you variable tables/columns, only the values.
<3> you=use...
<0> ah, sure
<3> so it would be "insert into foo (x, y) values (?, ?)"
<0> yeah thats much better. I'll try to do it like that
<0> thanks for the help!
<0> now bed
<3> gn.
<5> I have nontypical question
<5> let's say I am a gateway for some pc's
<5> I'm capturing some packet



<5> and I know the sequence number
<5> I talk about TCP/IP (over Eth)
<5> and now, how often does this number change
<5> ?
<3> do you actually know what the sequence number means? :-)
<5> I know that this number should change every next packet
<5> but my sniffer shows something else
<5> so I'm confused
<3> it changes for every new packet. it is the same for resent packets.
<5> and how it changes?
<5> how computers know which one is valid, and which not?
<3> senders sends packet N, then N + 1, then N + 2, ...
<5> weird
<3> how about you read up on TCP?
<3> perfectly sane.
<5> yes, I'm reading right now
<3> read first, then try stuff.
<5> Auris let me show you what I have logged
<5> and what is tottaly different than what rfc says
<6> mrrr
<5> ok now I'm loggin IRc
<6> hello.
<5> hello Ravi
<6> hey I_v0
<5> http://gigabit.cmpa.pl/OMFG/hmm
<3> are you using a proper sniffer and not you own cooking?
<5> Auris own cooking
<3> maybe you should learn about tcp with tcpdump or wireshark/ethereal.
<5> hmmm, but
<5> then if so, is there a way to open a socket and tell kernel to "continue" sending the packets?
<5> tell that the socket is already opened and send with this sequence number
<3> raw sockets. read phrack or something for hacking basics ;-)
<7> raw sockets?
<5> mhm
<7> thought they disabled it in linux xp sp2
<8> right.
<5> lcamtuf even with uid 0 ?
<3> I don't know. linux xp is for victims, not hackers.
<7> especially with uid 0
<5> hmmm
<5> althrough I'm fully aware as of how it sound, I'm not writing any hack
<5> in means exploit or smth
<7> yeah, you want to "keep sending" broken packets with bogus sequence numbers because you just wanted to visit disney.com
<7> we believe you
<5> trying to write something new, I have 8 i-net connections, and want to download file via HTTP/1.1 in parts, every computer 1/8 of file, then burst everything through LAN with a lot faster connection
<5> so I won't need ISP's help as if I would use bonding to that
<5> for that*
<7> there's no need for raw sockets for that, you know
<7> just connect the way the god intended
<7> use ranges in http header
<7> everything else is perverted
<5> I know about ranges, spend yestarday on them
<5> lcamtuf but how to do that? connect to what? appliaction is downloading the file already, for user's host it pretends to be server for ex. www.kernel.org and file linux-2.6.17.tar.gz
<5> the only way is to hijack the socket
<5> and keep pretending to be www.kernel.org
<7> use a transparent proxy functionality within whatever packet filtering gizmo you have
<7> and then proceed in a sane way in userspace
<9> no hooks available in some popular proxy software?
<7> or you can use non-transparent proxying if you don't mind altering browser settings
<7> but transparent proxies work well
<7> in essence, you instruct the kernel on the router/firewall to redirect all outgoing traffic to port 80
<7> to your local port 12345 or whatever
<7> you can then use regular syscalls to find out where the connection was meant to go
<7> and establish any number of connections on behalf of the user
<5> mhm
<7> the redirection is accomplished via a shell command (ipfwadm/ipchains/iptables/ip-whatever-is-this-week's-linux-packet-filter) or an appropriate syscall if you're hardcore
<5> Now I understood, so if we are 8 friends, everyone of us can point the server as a gateway, then one of us want's to download, so packet comes to server then is catched by transparent proxy (here proxy will need some coding to accomplish the task of creating connections through all friends which made a gateway on their computer but are pushing packets through server which then will download using not 1 but 8 connections and send transparently everyt
<5> hasn't that been done before?
<3> I didn't quite follow that.
<5> well, we are 8, everyone of us points computer nr 9 in our LAN as a gateway
<5> and everyone of us makes gateway on own computer, to provide the i-net connection to 9th
<5> to the server
<5> server catches the request opens 8ght connections
<5> and download files partially


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#worldchat
patteggiamento juventus
#worldchat
#worldchat
software raid 1 sync automatically
#worldchat
#worldchat
#worldchat
#worldchat
pikejla



Home  |  disclaimer  |  contact  |  submit quotes