Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: rewrite of epee library (partial, at least) #51

Open
who-biz opened this issue Apr 21, 2019 · 2 comments
Open

Enhancement: rewrite of epee library (partial, at least) #51

who-biz opened this issue Apr 21, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request low-priority Low Priority fixes/improvements

Comments

@who-biz
Copy link
Contributor

who-biz commented Apr 21, 2019

Not liking the things in that library. Historically, its been a source of a fairly large problem at least once (Cisco Talos). Comments in code don't seem to be happy with it either... which draws similar attention to p2p.

  • IP addressess handled irresponsibly...
  • Removed a gif-content-type from the http_base.h header file
  • For some reason we have code that handles all kinds of media/web files (?)
    -
    template<class t_connection_context>
    std::string simple_http_connection_handler<t_connection_context>::get_file_mime_tipe(const std::string& path)
    {
    std::string result;
    std::string ext = string_tools::get_extension(path);
    if(!string_tools::compare_no_case(ext, "gif"))
    result = "image/gif";
    else if(!string_tools::compare_no_case(ext, "jpg"))
    result = "image/jpeg";
    else if(!string_tools::compare_no_case(ext, "html"))
    result = "text/html";
    else if(!string_tools::compare_no_case(ext, "htm"))
    result = "text/html";
    else if(!string_tools::compare_no_case(ext, "js"))
    result = "application/x-javascript";
    else if(!string_tools::compare_no_case(ext, "css"))
    result = "text/css";
    else if(!string_tools::compare_no_case(ext, "xml"))
    result = "application/xml";
    else if(!string_tools::compare_no_case(ext, "svg"))
    result = "image/svg+xml";
    return result;
    }
    //-----------------------------------------------------------------------------------
    (Surely, most of this is probably very unnecessary)

Consider partial rewrite.

@who-biz who-biz self-assigned this Apr 21, 2019
@who-biz who-biz added the enhancement New feature or request label Apr 21, 2019
@who-biz who-biz changed the title Enhancement: rewrite of epee library Enhancement: (partial, at least) rewrite of epee library Apr 21, 2019
@who-biz who-biz added the fast-track Enhancements that need treated as important, just behind bugs in priority. label Apr 21, 2019
@who-biz who-biz changed the title Enhancement: (partial, at least) rewrite of epee library Enhancement: rewrite of epee library (partial, at least) Apr 21, 2019
@who-biz
Copy link
Contributor Author

who-biz commented May 10, 2019

epee namespace appears to be using ssize_t everywhere std::size_t occurs. since size_t is not always portable, this could be the reason... but can we need to make sure that std::size_t should indeed be a ssize_t as compiler says ... or, if it should be a size_t as name implies... we should make this clearer.

Other places this was occurring, as far as the linker was concerned:

  • src/checkpoints/checkpoints.cpp
  • external/easylogging.h
  • contrib/epee/include/misc_log_ex.h
  • src/crypto & src/crypto/crypto-ops in various files

Similarly, there is a special case going on with streams. If this is simply for portability -- great. No problems. But make the customized types less confusing

@who-biz
Copy link
Contributor Author

who-biz commented May 28, 2019

Something found when building the snap for v0.1.9.6 (snapcraft core uses ubuntu:16.04)

SnapBuildWarning

Definitely worth looking into what exactly is going on here... as it may be the cause of some of the p2p oddities, and looks to have the ability to affect everything that uses endpoint addresses.

@who-biz who-biz added low-priority Low Priority fixes/improvements and removed fast-track Enhancements that need treated as important, just behind bugs in priority. labels Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low-priority Low Priority fixes/improvements
Projects
None yet
Development

No branches or pull requests

1 participant