[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[gopher] gopher+ borkin -> bring on gopher++



Even the c complier is against gopher+:

[kimmy@one kgopherd]$ cat gopher+.c
#include <stdio.h>

int main(void)
{
        int gopher = 0;

        gopher+;

        printf("The next gopher version is: %i\n", gopher);
}

[kimmy@one kgopherd]$ cc -o gopher+ gopher+.c
gopher+.c: In function ‘main’:
gopher+.c:7: error: expected expression before ‘;’ token

[kimmy@one kgopherd]$ cat gopher++.c
#include <stdio.h>

int main(void)
{
        int gopher = 0;

        gopher++;

        printf("The next gopher version is: %i\n", gopher);
}

[kimmy@one kgopherd]$ cc -o gopher++ gopher++.c
[kimmy@one kgopherd]$ ./gopher++
The next gopher version is: 1

===

So it begins... I'm pretty much finished with some extensions to the gopher protocol (the original, not +) which would bring things like virtual hosts to gopher. The extensions are 100% backward and forward compatible with gopher0 - as in old gopher0 clients can talk to gopher++ servers, and gopher++ clients can talk to old gopher servers without any side-effects. Also, I'm not trying to bring gopher closer to the mess that is HTTP. As I see it HTTP has a dumb server and bloat.. um, smart client while gopher has a smart server but a dumb client (which is IMHO a MUCH better model).

Anyway, before I make a total fool out of myself by explaining my (potentially) stupid ideas, I'll just ask one "hypothetical" question:

What happens if a client sends more than one row of text to the server?

As far as I can see nothing bad happens. A gopher0 server reads one line of text (the selector) from the client, dumps some data to the client and closes the connection. Any extra data the client sends is never even read by the server.

I've tested this with bucktooth, pygopherd, gopherd and of course my own kgopherd (which was totally unmodified for this) and all worked just fine (and by fine I mean they ignored the extra data).

So, if anyone thinks this will break an existing server, please test it with the following netcat command (on Unix, should work with Cygwin on Windows) and send me the results.

$ printf "/\r\nextra line\r\nanother\r\none\r\n" | nc <host> 70




- Kim

_______________________________________________
Gopher-Project mailing list
Gopher-Project@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/gopher-project




Reply to: