Benjamin Sergeant

Results 110 comments of Benjamin Sergeant

Got it. Maybe the simplest approach to make progress would be to be able to pass in the host data as memory buffer (a char*), rather than a file path....

It's possible that the scanning takes time too, but parsing 500k of data certainly isn't free, in our case where our host files are big (managed by tool like chef)....

Link to the function to optimize -> https://github.com/c-ares/c-ares/blob/c25d4eb767aa0beb9bda355f56b3c324668742b6/src/lib/ares__readaddrinfo.c#L35

@bagder + @bradh352, would you be ok with the possibility to have a structure representing the result of parsing the /etc/hosts file be used, and set from curl ? Not...

Yes something along those lines. The downside will be that storing the pre-parsed version of /etc/hosts might consume more memory than ’streaming’ / scanning through it, but the upside would...

A 3 minutes google search found this C library for hash tables (I haven’t had to use C hash tables before, I mostly code in C++ where std::map and hash...

Sure. So this task would require to pick a good hash-table implementation and bundle it with the library, or go with a sorted list approach if needed. The link I...

We can try the simple implementation first, build the unsorted array on populate, and then sort with qsort when we’re done scanning/parsing. And search with bsearch afterwards. This way we...

I believe that by UNIX guidelines, SIGKILL cannot be trapped.

Ok, so if we want to disable this feature for having json or anything in one option, maybe a non-printable character would work, such a the nul character, which according...