} else if(fd >= 0) {
if((buf2 = icsmbstowcs(args, DCCHARSET, NULL)) != NULL)
transfersetpath(peer->transfer, buf2);
+ peer->transfer->flags.b.minislot = 1;
}
if(fd < 0)
{
- if(slotsleft() < 1)
- {
- qstr(sk, "$MaxedOut|");
- freedcpeer(peer);
- return;
- }
if((node = resdcpath(args, DCCHARSET, '\\')) == NULL)
{
qstrf(sk, "$Error File not in share|");
freedcpeer(peer);
return;
}
+ if(sb.st_size < 65536)
+ peer->transfer->flags.b.minislot = 1;
+ if(!peer->transfer->flags.b.minislot && (slotsleft() < 1)) {
+ qstr(sk, "$MaxedOut|");
+ freedcpeer(peer);
+ return;
+ }
if((offset != 0) && (lseek(fd, offset, SEEK_SET) < 0))
{
close(fd);
} else if(fd >= 0) {
if((buf2 = icsmbstowcs(args, charset, NULL)) != NULL)
transfersetpath(peer->transfer, buf2);
+ peer->transfer->flags.b.minislot = 1;
}
if(fd < 0)
{
- if(slotsleft() < 1)
- {
- qstr(sk, "$MaxedOut|");
- return;
- }
if((node = resdcpath(p, charset, '\\')) == NULL)
{
qstr(sk, "$Error File not in cache|");
qstr(sk, "$Error|");
return;
}
+ if(sb.st_size < 65536)
+ peer->transfer->flags.b.minislot = 1;
+ if(!peer->transfer->flags.b.minislot && (slotsleft() < 1)) {
+ qstr(sk, "$MaxedOut|");
+ return;
+ }
if((start != 0) && ((start >= sb.st_size) || (lseek(fd, start, SEEK_SET) < 0)))
{
close(fd);
} else if(fd >= 0) {
if((wbuf = icsmbstowcs(argv[1], "UTF-8", NULL)) != NULL)
transfersetpath(peer->transfer, wbuf);
+ peer->transfer->flags.b.minislot = 1;
}
if(fd < 0)
{
- if(slotsleft() < 1)
- {
- qstr(sk, "$MaxedOut|");
- goto out;
- }
if(!strncmp(argv[1], "TTH/", 4))
{
if((node = findbytth(argv[1] + 4)) == NULL)
qstr(sk, "$Error|");
goto out;
}
+ if(sb.st_size < 65536)
+ peer->transfer->flags.b.minislot = 1;
+ if(!peer->transfer->flags.b.minislot && (slotsleft() < 1)) {
+ qstr(sk, "$MaxedOut|");
+ goto out;
+ }
if((start != 0) && ((start >= sb.st_size) || (lseek(fd, start, SEEK_SET) < 0)))
{
qstr(sk, "$Error Offset out of range|");