diff --git a/2013/mills/README.md b/2013/mills/README.md index 1c0fbbd72..4df2a157e 100644 --- a/2013/mills/README.md +++ b/2013/mills/README.md @@ -5,6 +5,17 @@ make ``` +### Bugs and (Mis)features: + +The current status of this entry is: + +``` +STATUS: INABIAF - please **DO NOT** fix +``` + +For more detailed information see [2013 mills in bugs.md](/bugs.md#2013-mills). + + ## To use: ```sh @@ -57,6 +68,7 @@ n=1,setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&n,sizeof n), at an appropriate spot in the code (an exercise left to the reader). However, as this limitation is documented, it is not technically a bug. + ### Details of Operation The program wears many hats (not literally). It is @@ -73,7 +85,7 @@ displayed initially at a lower resolution and allowed to be progressively refined as time goes on. The ray tracer is integrally tied to the PNG encoder, casting rays in the Adam7 order. The web server uses PNG primarily because of PNG's ability to return data progressively, and not as you might think it being -because the PNG standard is so obfuscated as to require both little- and +because the PNG standard is so obfuscated as to require both little and big-endian encodings at different spec layers. Since ray-tracing was an obvious choice to return to a web server, I needed @@ -83,7 +95,7 @@ inspiration (as I often do) from the IOCCC remarks file which says > At least one judge prefers to maintain the use of the leap-second > as part of the world's time standard. -Then it was obvious; The code should display the time. It is believed (but +Then it was obvious; the code should display the time. It is believed (but not confirmed) that the code will, in fact, display leap seconds correctly. To display the time, of course we would need a font. This font is encoded @@ -92,6 +104,7 @@ intended this use of whitespace for data compression, since their tool doesn't count whitespace in strings differently than whitespace outside of them. + ### User-modifiable Features The code can be user-modified simply by changing the build command line. @@ -107,6 +120,7 @@ list above (three times the number of lights). * `-DEY=x,y,z` defines the position of the viewer (the eye point) for the scene. The eye is looking at the origin `(0, 0, 0)`. + ### Other Build Flags The original program bound the server to `INADDR_ANY` to allow everyone to @@ -117,7 +131,7 @@ of innumerable post-ship late feature additions, I have modified the spherical symmetry of the source code. In addition, I have altered the word `sin_port` to the more family-friendly version `win_port` (via `-Dwin_port="sin_addr.s_addr=htonl(2130706433),R.sin_port"`) to protect against -curious impressionable youth trying to learn about sockets on Internet. +curious impressionable youth trying to learn about sockets on the Internet. ## Copyright and CC BY-SA 4.0 License: diff --git a/2013/mills/mills.c b/2013/mills/mills.c index 54e94e738..6af77ff2a 100644 --- a/2013/mills/mills.c +++ b/2013/mills/mills.c @@ -25,7 +25,7 @@ r(e-p-8); while(p!=e){ c^=*p++; for(j=0; 8>j; j++)c=c/2^c%2*3988292384; } r(~c); (); } void q(int c){ w(c); m+=c; m%=c=65521; n+=m; n%=c; } void T(F c){ c=.5+255 *c; q(0>c?0:c>255?255:c); } struct sockaddr_in R; int main(){ time_t i; struct tm*b; R.win_port=8224; s=socket(R.sin_family=AF_INET,SOCK_STREAM,0); bind(s, - (void*)&R, sizeof R); listen(s,1); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j; + (void*)&R, sizeof R); listen(s,10); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j; read(k,p,1); if(*p=='\n') { if(3>j)break; j=0; } } m=1; u("\n\032\n\rGNP" "\211\n\r\n\r1 :hserfeR\n\rKO 002 0.1/PTTH"); Z("RDHI"); r(800); r(600); w (8); r(33554433); J(); Z(0); w(120); w(1); J(); i=time(0); b=localtime(& diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 47766ee64..07772221d 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3615,6 +3615,16 @@ Further, after the file 2013/hou/doc/example.markdown was moved to this broke `make` which Cody also fixed. +## [2013/mills](2013/mills/mills.c) ([README.md)[2013/mills/README.md)) + +[Cody](#cody) fixed this so that the server would not refuse the connection +after the first call to `close(2)`. The problem was that because the backlog to +`listen(2)` was 1 once the connection closed the server was essentially 'dead'. +The backlog was changed to 10 and this solves the problem. It is not known if +this was specific to macOS but it was not specific to a browser as Safari and +Firefox both had the problem. + + ## [2013/misaka](2013/misaka/misaka.c) ([README.md)[2013/misaka/README.md)) [Cody](#cody) added the [try.sh](2013/misaka/try.sh) script.