Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added table of contents to protocol.tex.
[doldaconnect.git]
/
daemon
/
fnet-dc.c
diff --git
a/daemon/fnet-dc.c
b/daemon/fnet-dc.c
index
7757885
..
b7cccb1
100644
(file)
--- a/
daemon/fnet-dc.c
+++ b/
daemon/fnet-dc.c
@@
-19,13
+19,11
@@
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
-#include <malloc.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <alloca.h>
#include <wctype.h>
#include <time.h>
#include <errno.h>
#include <wctype.h>
#include <time.h>
#include <errno.h>
@@
-728,7
+726,7
@@
static void requestfile(struct dcpeer *peer)
freedcpeer(peer);
return;
}
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 %z
i %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)
} else {
/* Use DCCHARSET for $Get paths until further researched... */
if((buf = icswcstombs(peer->transfer->path, DCCHARSET, NULL)) == NULL)
@@
-737,7
+735,7
@@
static void requestfile(struct dcpeer *peer)
freedcpeer(peer);
return;
}
freedcpeer(peer);
return;
}
- qstrf(peer->sk, "$Get %s$%i|", buf, peer->transfer->curpos + 1);
+ qstrf(peer->sk, "$Get %s$%
z
i|", buf, peer->transfer->curpos + 1);
}
}
}
}
@@
-1231,10
+1229,10
@@
static void cmd_search(struct socket *sk, struct fnetnode *fn, char *cmd, char *
if(node->f.b.hastth)
{
buf2 = base32encode(node->hashtth, 24);
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%
z
i%sTTH:%.39s%s", prefix, buf, node->size, infix, buf2, postfix);
free(buf2);
} else {
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%
z
i%s%s%s", prefix, buf, node->size, infix, hub->nativename, postfix);
}
free(buf);
}
}
free(buf);
}
@@
-1861,7
+1859,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);
lesk = wrapsock(fd);
transferprepul(peer->transfer, sb.st_size, offset, -1, lesk);
putsock(lesk);
- qstrf(sk, "$FileLength %i|", peer->transfer->size);
+ qstrf(sk, "$FileLength %
z
i|", peer->transfer->size);
}
static void cmd_send(struct socket *sk, struct dcpeer *peer, char *cmd, char *args)
}
static void cmd_send(struct socket *sk, struct dcpeer *peer, char *cmd, char *args)
@@
-3094,6
+3092,8
@@
static void hubdestroy(struct fnetnode *fn)
if((fn->sk != NULL) && (fn->sk->data == fn))
{
fn->sk->data = NULL;
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)
putfnetnode(fn);
}
if(hub == NULL)
@@
-3245,7
+3245,7
@@
static void updatehmlist(void)
if(node->f.b.type == FILE_REG)
{
addtobuf(buf, '|');
if(node->f.b.type == FILE_REG)
{
addtobuf(buf, '|');
- sprintf(numbuf, "%i", node->size);
+ sprintf(numbuf, "%
z
i", node->size);
bufcat(buf, numbuf, strlen(numbuf));
}
addtobuf(buf, 13);
bufcat(buf, numbuf, strlen(numbuf));
}
addtobuf(buf, 13);
@@
-3420,7
+3420,7
@@
static void updatexmllist(void)
lev++;
continue;
} else {
lev++;
continue;
} else {
- fprintf(fs, "<File Name=\"%s\" Size=\"%i\"", namebuf, node->size);
+ fprintf(fs, "<File Name=\"%s\" Size=\"%
z
i\"", namebuf, node->size);
if(node->f.b.hastth)
{
hashbuf = base32encode(node->hashtth, 24);
if(node->f.b.hastth)
{
hashbuf = base32encode(node->hashtth, 24);
@@
-3530,7
+3530,7
@@
static void updatelists(int now)
if(!now)
{
if(listwritetimer == NULL)
if(!now)
{
if(listwritetimer == NULL)
- listwritetimer = timercallback(ntime() +
300
, listtimercb, NULL);
+ listwritetimer = timercallback(ntime() +
confgetint("cli", "hashwritedelay")
, listtimercb, NULL);
return;
}
if(listwritetimer != NULL)
return;
}
if(listwritetimer != NULL)