Older blog entries for gnutizen (starting at number 11)

My development of Gnutizen has been off again, on again. Actually, the only real CVS updates I made since September 2002 when I put it on Sourceforge, were in April/May of last year (2003) when I ported it to Linux and made a hack for the htons() call, ignored SIGPIPE/EPIPE signals (which I believe is normal to do), and also made changes so Microsoft's C/C++ compiler would compile it under Windows, and not just gcc/mingw compilers.

Since then I have been mostly working to focus on fixing problems in the existing application before adding new features.

However, getting other servents to connect to has been more of a problem as time goes on. My servent starts with a cache (an out-of-date one nowadays), and finds hosts only by pong (not 0.6 protocol methods like X-Try or X-Try-Ultrapeers, or web caching, or other methods). It also seems to be rejected by Limewire version 3 servents and Bearshare servents - perhaps because it does not know QRP or something. I've been spending the time I've spending on it in the past weeks just finding some servents to connect it to. That's coming along, I will see how it goes. Then I will try to fix bugs. Hopefully the big clients phasing out people using older protocol stuff is not at the point where I have to add QRP and the like, as I'd prefer to try and get the bugs out first.

Me and my friend are writing a commercial software product (mostly in C), this is the end of week 3 of our venture. Week 1 I spent setting up my network connection and computer mostly. Week 2 I wrote a small program. Week 3 (this week) I wrote a small program as well.

My work desktop is a FreeBSD. It has 2 9 gig disks but I want to use the other disk for a dual boot Linux so I am cramped for space. I like to use BASH so I used the existing bash - /usr/compat/linux/bin/bash. This did some weird stuff like make my uname say "Linux" instead of "FreeBSD" and some other things so I installed a new bash from FreeBSD ports. Maybe this was why Mozilla and Gnome wouldn't compile (or maybe not). I'm currently using Epiphany and Wmaker instead.

I only seriously started programming in C starting last year...my partner knows a bit about C so I have been dealing with some new things these past two weeks like linked libraries (static versus dynamic), linked lists and so forth. In terms of my code readability, he prefers gindent use K&R indentation as opposed to GNU indentation, and he also says I need better variable and function names (which is true).

Argh. Sourceforge's CVS is barfing again.

can't create temporary directory /tmp/cvs-serv27134
No space left on device

And no, that's not on my machine. The last time I tried to CVS my project from Sourceforge months ago, their whole server was down. Then there's the ssh change they made from ssh1 to ssh2 or whatever that took me a day to fix. Actually, I see that popular projects like GAIM are having the same problem as well, so. Bleh. I have a version of the code, but the recent changes are all out of sync and this is a pain.


I've never really MUDed much, but a few weeks ago I went back to a MUD I was on many years ago, Arctic, and now have a level 8 mage. When I went on years ago I wasn't really interested in playing, I knew one of the "immortals" and just went on to chat with her. I was at a bookstore a few weeks ago though and was reading through a book called something like "How to be a game programmer: interviews with all the awesomest game designers" or something along those lines. I've never played Everquest, I don't even have a credit card to pay however much a month even if I wanted to, but it interests me, so I read the interview with the EQ designer. He said they did a few things to prepare their MMORPG, including play a lot of MUDs and write down what they liked and what they didn't like. Like many people, I have a ton of ideas I'd like to do, but have a definite lack of capital, free time as well as programming skill - in fact I'd say those things are intertwined somewhat. I do have an idea of an MMORPG though - to save on capital, among other reasons, it would try to be more p2p based than server based, and it would have a definite game theme which I won't go into currently.

So one thing I've become interested in is MUD clients. I'm interested in ones that are free - free as in both meanings. What I'm interested in are Windows clients, and to some extent command-line UNIX clients, and less so graphical UNIX ones. The main one I've been using is TinyFUGUE, which is a command line UNIX one. It's decent, and I've been using it. I just tried JamochaMUD, a Java one that runs on Windows (and I guess UNIX). The display often becomes scrambled though, so I'm not going to use it. So my search goes on for a good free (both meanings) MUD client.


Well, I guess there are groups using W.A.S.T.E., but it hasn't taken off like I'd expected, which AOL coming down on it didn't help. I'm sure small groups of people are finding it useful, and they're out there. I got somewhere down the list of the client, then got busy, then when I didn't see momentum I tossed in the towel. That "awesomest and successful game designers" book I mentioned before had several people interviewed say that what they really looked for in a designer was someone who didn't just start projects but completed them. Of course, that's not always an axiom, it of course makes sense to abandon a project when it has no utility any more. But that has stuck in my mind and is motivation to look at my Gnutella clone project Gnutizen again. It is true that I have very little free time, but if I can get around that I'll be looking at it again. I have to weed the bugs out, and then add on the non-leech functionality. I did get it to the point where it can download files though so it has reached the first step of acceptability, now I just have to get it to specs of an old Gnutella document which I'm sure no one but me cares anything about any more.


Well I keep hearing about Knuth, Knuth, Knuth so I finally went out and plucked down $150 or whatever for the three books he's written so far. A lot of math. A lot. As I said before, I really have no free time, especially to sit down and concentrate intently for a few hours each day, every day. So Knuth will probably have to stay on my shelf for a while.

Economy/Jobs etc.

Well as I said in diary entries before, I am a systems administrator mainly, who just got seriously interested in programming, and I've been learning by doing mostly. I mean, I already know languages like PERL somewhat, but I've been writing stuff in C. Later on I might pick up C++ and Java. But anyhow I am mainly a systems administrator.
Anyhow I will not go into giving my opinion or trying to convince people or get into a discussion or argument. Especially since to me getting into an argument with someone who's here that is a manager and has a different not only point of view, but different interests, often diametrically opposed to mind. So I'm just speaking now to people who are workers - programmers, admins, and whatnot, who are tired of the rising unemployment rates, and tired of falling industry wages and so forth. And my message is - I'm with you. And also - we can't figth this as individuals. The IT employers - Microsoft, Intel, IBM and so forth have been well-organized and funding things like the evil ITAA for years - and the ITAA has taken that millions in funding and gone to Washington DC and screwed us over. And not just DC - they commissioned phony baloney reports about a lack of IT workers and got it all out in the press to fool the public, to "fool" Washington DC (although I'm sure campaign contributed made that easier) and even to fool some of us. Anyhow, they're organized, and now that we're under attack, now that our industry wage is falling, and of course I'm only talking to fellow workers (excluding any managers or whoever who may disagree), what we have to do is organize and fight back. You've been made about this, you've been wondering what you can do as an individual, and what I'm saying is, the employers and ITAA are not doing it as individuals, they're not fighting the system alone, why should we? So check out the Programmers Guild or even some of the more union-associated ones like WashTech. There's an old slogan "educate, agitate, organize". Before you do that you have to get educated, get agitated and get organized though. And the least important thing is the possibility of some AFL-CIO union coming in and getting collective bargaining contracts for X% of the industry (actually, surprisingly enough, they already probably do have 1-2% of the industry, whether you know it or not). What's important is that people wake up and organize together and educated themselves on issues that effect us, and our wallets. The employers are organized, why aren't we? Doctors and lawyers are organized in the AMA and ABA, if we're "professionals" why aren't we? And please don't mention the IEEE or any junk like that. The IEEE is corporate sponsored for one thing (can you imagine the AMA being corporate sponsored?) and for a second thing the leaders have killed anything good that members have proposed over the past few years. Associations like the IEEE see their job beginning and ending with making sure your skill level increases, and any other interest you have goes out the window. So check out the guild and Washtech, watch the Usenet groups like alt computer consultants for discussions and get involved. Believe me, most of the engineers like yourself have the same kinds of ideas and concerns as you do - and the way you would like to see things not going is the same as theirs.

It shows how screwed up American society is that this often has a "debate". Could you imagine IBM, Intel and Microsoft management having debates over whether to fund the ITAA with arguments like "if we're such a good company, we don't need someone in Washington DC looking out for our interests". There's a reason these people are running the world, and Farscape watching dorks full of hubris about their own ability are getting the shaft. But as I said several times, my message is not directed to those people but to those who already agree and hopefully I will be a little nudge that helps push them along, sometimes people want to be invited to the party before coming.

9 Jun 2003 (updated 28 Sep 2003 at 23:33 UTC) »

Well, those guys at Nullsoft have released another p2p application, W.A.S.T.E., and I've been checking it out. They released the C++ code for it, but I don't know C++, so I've begun hacking out the protocol in C.

The documentation says that, when you have a potential host to connect to, WASTE connects, and sends 40 bytes to the other host, which consists of (if there is no network name), 16 random bytes, as well as 24 more bytes which is a blowfish of the random bytes with a 20-byte SHA-1 of my public key plus 4 pad bytes. If the remote host knows my public key, it sends a 40 byte response.

I used Ethereal to sniff a send to a host running WASTE that has my key to get a 40 byte send. I sent that send to the host and also get a 40 byte response. In the C++ code, I see that g_pubkeyhash is the 20 bit public key hash encrypted, and that WASTE uses (a possibly modified version of) Paul Kocher's Blowfish code. So I'm messing around with this for now. The source I'm reading is in C++, a language I don't know, so I guess I can be forgiven for not totally understanding it. I often wonder how much faster I would be at writing code if I had years of experience under my belt. Much faster, I guess.

Well in the C language Gnutella clone that I'm developing, gnutizen, the SIGPIPE from the send() is now caught (although not in CVS), but now it seems in the same relative place that a SIGSEGV (segmentation violation) happens. Most of what I've read says that the SIGPIPE is fairly normal and catching it, or turning it into an EPIPE with a signal from send - the remote end simply breaks the connection and there's not much you can do about it. The segmentation fault looks like something I have to track down more though.

I had access to systems running Solaris, OpenBSD, and Windows previously, now I have access to a FreeBSD and Linux. I noticed while demonstrating to my friend that there is a problem with the file download in Linux. So that's another bug I'll have to fix.

I got a copy of Microsoft Visual C++ 6.0. I guess it's pretty old (1998). That's fine though, I'll run it on my Windows 98, and get ahold of whatever Developer Studio thing compiles C nowadays afterwards. I ran gnutizen through it and encountered a bunch of problems. It choked on "#include <sys/time.h>", as well as an include of unistd.h. It didn't know the call strncasecmp(). More importantly I made a character array with a constant size of 0 that it barfed on. The others I fixed in CVS, the single character "array" I didn't yet, that's next on my plate but I haven't run into any walls...yet. MSVC++6 has some nice features like seeing what calls are made inside a function, and where else in the program the function itself is called, as well as other features. Once I clean up the array thing I guess I'll see if it has any more useful stuff aside from making solely Windows installation easier (I made a nifty icon for Gnutizen for Windows).

So when I've had time to work on this program since early April, that's mostly what I have been doing...dealing with bugs and making sure things run cross-platform. There's not much point in adding new features if there are big bugs around that crash the program or prevent downloading.

I figured out (with a little help from gdb) why gnutizen was dying after a few minutes of running on it's new high speed FreeBSD and Linux development boxes - during a send it would get a SIGPIPE signal, because it would be writing to a socket/"pipe" after the other end had already broken the connection and was not reading. I put in a hack that catches the SIGPIPE signal, so now the program keeps running. I see that send has flags on some systems that turns SIGPIPE into EPIPE. I can attempt a better fix for this later, for now, the hack is OK. I will put it up on CVS, hopefully tonight.

Ah..my first Advogato posting in over six months...well, I just got access to some more machines, Linuxes and FreeBSDs, and I wanted to run gnutizen on them, maybe even have it run 24/7 on some of them...well, I noticed, now that I finally have my hands on a normal networked Linux account, which box I even have root on, I see that gnutizen does not work once compiled! I tracked down the problem, apparently the byte order/endianess/whatever of the port is wrong, so I did a hack, which is not in CVS yet, and it worked, so that's good. The program seems to die after a few minutes of running on FreeBSD or Linux, as was the case with the high-speed OpenBSD it was on, I'll have to check into that with gdb, strace and all that.

I opened an account on Sourceforge and put Gnutizen up there. Although Gnutizen is functional in terms of being able to connect to, search, find and download from the Gnutella network, we have not yet implemented functions like sharing, traffic routing and so forth, and thus are still in "alpha" mode as we are not ready to be a good Gnutella citizen yet, so I slapped on about 1000 messages everywhere regarding that (on the home page, in the UI, by not releasing the code so it is only gettable by CVS etc.). Of course, developers looking at the code, trying to compile and run it and so forth would be helpful at this point, so I put it up on SF. Mondragon has been going through the code and has made some improvements.

Setting up WinCVS, plink, and all of that was a hassle. Yes I use WinCVS...if Debian had an installer as good as FreeBSD does I'd probably be developing on Debian. Doing an init of the project was a hassle so I winded up init'ing it from my sourceforge shell. After that I got WinCVS/plink working (although I'll have to see if there's a flag for plink to close the window it pops up when it's done, otherwise I get a new pop-up window that sticks around with every commit). Then SourceForge's CVS server went down for about an hour this morning. But otherwise it's pretty good. I'd prefer not to release a tgz of the program before beta but I might wind up doing that. We'll see.

I went to the NYLUG meeting for the first time yesterday. The meeting was two people doing a presentation about PHP. There were over 50 people there but I didn't know anybody, I figured I might see at least 1 person I knew. Nothing I was that interested in, I've used PHP on web sites, with MySQL connections and so forth, but nothing I was that interested in. I've been thinking for a while it might be cool to have a "P2P/distributed computing/whatever" group in New York. Not one that met every week, more like every few months, unless people were otherwise interested. I already know OF some p2p developers that live in New York, although I do not "know" them - that's why to have the meeting though, right? I already have in mind some people I'd invite to a possible meeting in a few weeks (or months), if you live near NYC, and are interested in P2P or distributed computing, and would be interested in a meeting, send me e-mail. My e-mail is at the bottom of my advogato profile - gnutizen at yahoo dot com.

I put up an updated alpha version of Gnutizen - alpha 0.07. I implemented the threads functionality so it can have multiple connections simultaneously. I also put in code so that it can download the files it finds. So now it's actually a useful Gnutella servent, although I have to put in sharing and routing and so forth before a version 1 release, Gnutizen needs to be a good Gnutella citizen (that's where the gnutizen name is derived from after all).

I've been working on 0.08 since. I decided to change from version 0.4 Gnutella handshaking to version 0.6 handshaking. Now I see what version of clients I'm connecting to which is handy, and I also have a better shot at connecting supposedly.

Yesterday and today I've been grafting a Windows GUI onto the program. I see that GTK-Gnutella says it's aiming to separate it's core and interface functions. I've been planning that since day one, as well as being cross-platform, which saves me time in the long run. I never programmed a Windows GUI before aside from a skeleton - I've gotten it so that the connected hosts as well as a tally of how many queries they've seen show up on the GUI though. I realized I needed more room so started looking at tabs or MDI - this seemed like a lot of code changes so I put it aside for today. I like having real-time updates of host connections. In the future I'll probably do an X-Windows GUI.

I just started working on message passing. I'm putting query GUID's and what connection they come from in a table. Soon I will pass on queries, and if queryhits come back I'll look in the table to see where to forward them.

Gnutizen was crapping out on Solaris, but then I saw that my big-endian autoconf marker wasn't showing up. I'll have to fix that. I ran splint (lint) on gnutizen - it marked gethostbyname() as a memory leak but then I saw it was static, so it's not really a leak. Splint found some things to fix though, like unused int's to remove and so forth.

2 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!