[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-GNUnet] gnunet-bugs
From: |
Jürgen Appel |
Subject: |
[bug-GNUnet] gnunet-bugs |
Date: |
Thu, 25 Jul 2002 15:33:18 +0200 |
User-agent: |
KMail/1.4.1 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
I was experimenting a while with gnunet and I like the concept.
To make it widespread and useful, maybe someone has to write a
Windows-GUI to have more Users use it, but well, that's not what I am
writing for.
After having gnunetd running for a while it regularily got stuck,
consuming 100% cpu.
The reason for this is a small bug in cron.c in routine
void addCronJob()
When you grow the list if there is firstFree==-1 the "next"-Link of the
last new created free entry points to entry number "deltaListSize_"
instead of "-1".
So after having grown the list for the first time there will always be
another free entry and no entry with nexxt=-1. Old entries get
overwritten. Once the list gets corrupted this way the program gets
stuck in the while loop if a job with delta=! is inserted while all
deltas are 0.
The fix:
xfree(deltaList_,
"addCronJob: old deltaList");
deltaList_ = tmp;
| for (i=deltaListSize_+1;i<deltaListSize_*2;i++)
| deltaList_[i].next = i-1;
| deltaList_[deltaListSize_].next=-1;
deltaListSize_ = deltaListSize_ * 2;
firstFree_ = deltaListSize_-1;
}
I found another "bug":
I am forced to use a transparent Proxy and cannot access port 80 of the
hostlist-server directly. But the Proxy is missing a "HTTP/1.0" - Tag
in the GET-Line.
So in file server/heloexchange.c I had to make the following
adjustments:
#define GET_COMMAND "GET %s HTTP/1.0\r\n\r\n"
Also I had to teach gnunetd to ignore the HTTP-Answer-Codes that preceed
the hostlist data.
char c;
#if PRINT_HELO
print("Receiving hostlist...");
#endif
time(&start);
| /* we first have to read out the http_response*/
| /* it ends with four line delimiters: "\r\n\r\n" */
| curpos=0;
| while (curpos<4) {
| if (start + 30 < time(NULL))
| break; /* exit after 30s */
| ret = recv(sock,&c,sizeof(c), MSG_DONTWAIT);
| if (ret == 0)
| break;
| if (ret < 0)
| if (errno != EAGAIN)
| break;
| else
| ret = 0;
| if ((c=='\r') || (c=='\n'))
| curpos += ret;
| else
| curpos=0;
| }
|
| if (curpos<4) { /* we have not found it */
|#if PRINT_CRON
| print("CRON: exit downloadHostlist (error: no http response
|read)\n");
|#endif
| return;
| }
while (1) {
if (start + 30 < time(NULL))
break; /* exit after 30s */
Greetings
Jürgen
- --
GPG key:
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=jappel%40linux01.gwdg.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAj0//iIACgkQ7h8HhBg+h9UQOwCgkYVmcX8lIcfxkF1OmQLlkHye
1kMAoKLvpsJfSVDlGMn8pS5sVlWeSvH7
=H/0A
-----END PGP SIGNATURE-----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-GNUnet] gnunet-bugs,
Jürgen Appel <=