X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Ffnet-dc.c;h=7cbb32ea45a8d370b0900d574ccae2f15cd376f3;hb=ddb3658e4a9d9efb7a8628fee483e5371c426d12;hp=d45b14489c9afa97d12aaacb0d31b985d2d1d680;hpb=cab0b442977697b876127cda082b1262ece2714b;p=doldaconnect.git diff --git a/daemon/fnet-dc.c b/daemon/fnet-dc.c index d45b144..7cbb32e 100644 --- a/daemon/fnet-dc.c +++ b/daemon/fnet-dc.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -728,7 +727,7 @@ static void requestfile(struct dcpeer *peer) freedcpeer(peer); return; } - qstrf(peer->sk, "$UGetBlock %i %i %s|", peer->transfer->curpos, peer->transfer->size - peer->transfer->curpos, buf); + qstrf(peer->sk, "$UGetBlock %zi %zi %s|", peer->transfer->curpos, peer->transfer->size - peer->transfer->curpos, buf); } else { /* Use DCCHARSET for $Get paths until further researched... */ if((buf = icswcstombs(peer->transfer->path, DCCHARSET, NULL)) == NULL) @@ -737,7 +736,7 @@ static void requestfile(struct dcpeer *peer) freedcpeer(peer); return; } - qstrf(peer->sk, "$Get %s$%i|", buf, peer->transfer->curpos + 1); + qstrf(peer->sk, "$Get %s$%zi|", buf, peer->transfer->curpos + 1); } } @@ -1231,10 +1230,10 @@ static void cmd_search(struct socket *sk, struct fnetnode *fn, char *cmd, char * if(node->f.b.hastth) { buf2 = base32encode(node->hashtth, 24); - qstrf(dsk, "%s%s\005%i%sTTH:%.39s%s", prefix, buf, node->size, infix, buf2, postfix); + qstrf(dsk, "%s%s\005%zi%sTTH:%.39s%s", prefix, buf, node->size, infix, buf2, postfix); free(buf2); } else { - qstrf(dsk, "%s%s\005%i%s%s%s", prefix, buf, node->size, infix, hub->nativename, postfix); + qstrf(dsk, "%s%s\005%zi%s%s%s", prefix, buf, node->size, infix, hub->nativename, postfix); } free(buf); } @@ -1861,7 +1860,7 @@ static void cmd_get(struct socket *sk, struct dcpeer *peer, char *cmd, char *arg lesk = wrapsock(fd); transferprepul(peer->transfer, sb.st_size, offset, -1, lesk); putsock(lesk); - qstrf(sk, "$FileLength %i|", peer->transfer->size); + qstrf(sk, "$FileLength %zi|", peer->transfer->size); } static void cmd_send(struct socket *sk, struct dcpeer *peer, char *cmd, char *args) @@ -3094,6 +3093,8 @@ static void hubdestroy(struct fnetnode *fn) if((fn->sk != NULL) && (fn->sk->data == fn)) { fn->sk->data = NULL; + fn->sk->readcb = NULL; + fn->sk->errcb = NULL; putfnetnode(fn); } if(hub == NULL) @@ -3245,7 +3246,7 @@ static void updatehmlist(void) if(node->f.b.type == FILE_REG) { addtobuf(buf, '|'); - sprintf(numbuf, "%i", node->size); + sprintf(numbuf, "%zi", node->size); bufcat(buf, numbuf, strlen(numbuf)); } addtobuf(buf, 13); @@ -3420,7 +3421,7 @@ static void updatexmllist(void) lev++; continue; } else { - fprintf(fs, "size); + fprintf(fs, "size); if(node->f.b.hastth) { hashbuf = base32encode(node->hashtth, 24); @@ -3530,7 +3531,7 @@ static void updatelists(int now) if(!now) { if(listwritetimer == NULL) - listwritetimer = timercallback(ntime() + 300, listtimercb, NULL); + listwritetimer = timercallback(ntime() + confgetint("cli", "hashwritedelay"), listtimercb, NULL); return; } if(listwritetimer != NULL) @@ -3709,11 +3710,31 @@ static void terminate(void) static struct configvar myvars[] = { + /** Specifies the share description reported to other DC users. */ {CONF_VAR_STRING, "desc", {.str = L""}}, + /** Specifies the speed reported to other DC users. Normal values + * are 28.8Kbps, 33.6Kbps, 56Kbps, Satellite, ISDN, DSL, Cable, + * LAN(T1) or LAN(T3)*/ {CONF_VAR_STRING, "speedstring", {.str = L"LAN(T1)"}}, + /** The e-mail address to report to other DC users. */ {CONF_VAR_STRING, "email", {.str = L"spam@spam.org"}}, + /** Specifies a specific UDP port to use for DC search results. If + * left unspecified, a port is allocated dynamically. Useful for + * NAT routers (see also the net.visibleipv4 address for those + * cases). */ {CONF_VAR_INT, "udpport", {.num = 0}}, + /** Specifies a specific TCP port to use for DC peer + * connections. If left unspecified, a port is allocated + * dynamically. Useful for NAT routers (see also the + * net.visibleipv4 address for those cases). */ {CONF_VAR_INT, "tcpport", {.num = 0}}, + /** If set to true, doldacond will do its best to emulate DC++ + * (currently v0.674). This should be left off if at all possible, + * since turning it on will violate the rules of most hubs and + * thus give hub owners an actual reason to kick you if it is + * detected. It might be needed for some of the more bone-headed + * hub owners, though. Note that DC++ emulation can also be turned + * on or off for individual hubs, overriding this setting. */ {CONF_VAR_BOOL, "dcppemu", {.num = 0}}, {CONF_VAR_END} };