Giter VIP home page Giter VIP logo

yaxc's People

Contributors

darmiel avatar deepsourcebot avatar dependabot[bot] avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yaxc's Issues

Data Race in Cache

DBUG | SetHash ( helloworld , 8a6a8d0bd78b0da907b091a755e69f61 , 1m0s )
DBUG | get ( hash::helloworld ) = 8a6a8d0bd78b0da907b091a755e69f61 , <nil>
DBUG | get ( hash::helloworld ) = 8a6a8d0bd78b0da907b091a755e69f61 , <nil>
DBUG | get ( hash::helloworld ) = orld8d0bd78b0da907b091a755e69f61 , <nil>
DBUG | get ( hash::helloworld ) = orld8d0bd78b0da907b091a755e69f61 , <nil>

[v1.2] Concept

CLI

  • gpg signature check (#28)
  • survey (-m)

GLOBAL FLAGS:

  • anywhere
  • key (whitelist key) (#24)

๐Ÿš€ push

merge paste into push

FLAGS:

  • anywhere*>
  • secret>
  • ttl
  • base64
  • hash
  • gpg-sign (#28)

OTHER:

  • from pipe
  • from stdin
  • from file (#25)
  • from web (proxy?) (#29)

๐Ÿ‘ˆ pull

merge get into pull

FLAGS:

  • anywhere*>
  • secret>
  • `base64
  • gpg-sign (#28)

OTHER:

  • to stdout
  • to file (#25)

๐Ÿ‘€ watch

  • compare last updated
    • store DateTime (#30)

FLAGS:

  • anywhere*>
  • secret>
  • check-delay
  • base64
  • gpg-sign (#28)
  • no-pull
  • no-push

Server

  • whitelist-key database (#24)

PARAMETERS:

FLAGS:

  • enable-whitelist-key (#24)

Cache data race / buffer overwrite fix

Hi,

in response to your StackOverflow question and Data Race in Cache #8, see majodev/yaxc for a minimal reproduction test and fix.

TL;DR:
Go fiber zero allocation. The byte slice buffer that holds your strings path and hash which you got from ctx is only valid within the handler. The key/values stored inside your cache map will change as these strings are still based on this buffer that gets reused in each handler.

Either:

  • Create a new Buffer from the read values inside the handler and copy its contents over
  • or use the utils.ImmutableString util (same as above)
  • or use the Immutable config flag (perf penalty, no longer zero allocated context).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.