Giter Site home page Giter Site logo

marmotte's People

Contributors

killiankemps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

marmotte's Issues

Panic on bogus menu

Marmotte panicks with this error when accessing a bogus menu:

thread 'main' panicked at 'byte index 1 is out of bounds of ``', src/libcore/str/mod.rs:2051:9

URL of bogus Menu: gopher://khzae.net:70/1/s1000d

The bogus menu has a line without an item type.
On vf-1 I see this line is not displayed at all.

Part of the page retrieved by curl:

$ curl gopher://khzae.net:70/1/s1000d

iTools and other resources for the Specification 1000D		error.host	1
i 		error.host	1
		''.                  ....                            	70
i        ..,'',:,;.'''.            .'.  .'..',cc;;,;,''..             		error.host	1
i            cllll:c:.              .,,;c:,c,:cllllllllc;             		error.host	1
i              'c..              .clllllllc;l:;..;lc';lc,.            		error.host	1
[…]

We should avoid to have a panic error and maybe try to fallback like vf-1 by ignoring bogus lines.

Panic on text entry interpreted as menu entry

How to reproduce bug

Go to gopher://zaibatsu.circumlunar.space:70/1/updates/
Then open first entry 1 called "Release Retrospective"

Error: thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 3', /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/slice/mod.rs:2717:10

Investigation

A curl gopher://circumlunar.space:70/1/~sloum/phlog shows that the first entry begins with a 1 so it is normal to be interpreted as a menu entry:

curl gopher://circumlunar.space:70/1/~sloum/phlog
i .       .   .     -      ,   -     ,    .	false	null.host	1
i     +              *       _________ .     .	false	null.host	1
i.           *    ,      +  /         \    +	false	null.host	1
i    .    -           .    / //        \ *   .	false	null.host	1
i  ,    .   |   +    '    |             |   .	false	null.host	1
i         --+-- s l o u m | ||          | +	false	null.host	1
i |   *     | *    '   *   \\\___    /\/ .  '	false	null.host	1
i-+- ____     .           . \/   \  /  \  __	false	null.host	1
i |_/    \___     _   +  .  /\/\/\\/  : \/  \	false	null.host	1
i/\\\\o  |\l \___/|\ +    _/ --  |/\: ../  ...	false	null.host	1
i|////o  \\\      L \____/   __ _  _  ___:_ __	false	null.host	1
i               _____________	false	null.host	1
i              |\   phlog.   \  	false	null.host	1
i______________|_\============\_______________ 	false	null.host	1
i	false	null.host	1
1191209-19 - Release Retrospective	/~sloum/phlog/20191209-19.txt	circumlunar.space	70
0191107-22 - Go On Gopher	/~sloum/phlog/20191107-22.txt	circumlunar.space	70
0191018-16 - Jaffar	/~sloum/phlog/20191018-16.txt	circumlunar.space	70
0191005-22 - Bombadillo updates	/~sloum/phlog/20191005-22.txt	circumlunar.space	70
0190719-19 - This and that	/~sloum/phlog/20190719-19.txt	circumlunar.space	70
0190609-16 - Orion	/~sloum/phlog/20190609-16.txt	circumlunar.space	70
[…]

However, another Gopher client like VF-1 displays the first item as a text entry when the resource is requested.

It seems the bug is more on the gopherhole side. However, VF-1 manages it in a way to display the menu as a text entry.

Should marmotte fail gracefully like VF-1 into text mode if the menu doesn't display correctly or should marmotte display an error about the requested page without panicking?

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.