mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-23 10:05:08 +00:00
send final bit to server
This commit is contained in:
parent
fb429260a1
commit
f2b17dfda5
6
dns.c
6
dns.c
@ -261,6 +261,7 @@ dns_write(int fd, int id, char *buf, int len)
|
||||
{
|
||||
int avail;
|
||||
int i;
|
||||
int final;
|
||||
int parts;
|
||||
int p;
|
||||
char data[257];
|
||||
@ -276,8 +277,13 @@ dns_write(int fd, int id, char *buf, int len)
|
||||
avail -= (avail/CHUNK); // make space for parts
|
||||
|
||||
avail = MIN(avail, len); // do not use more bytes than is available;
|
||||
final = (avail == len); // is this the last block?
|
||||
d = data;
|
||||
|
||||
// First byte is 0 for middle packet and 1 for last packet
|
||||
*d = '0' + final;
|
||||
d++;
|
||||
|
||||
parts = avail / CHUNK;
|
||||
for (p = 0; p < parts; p++) {
|
||||
for (i = 0; i < CHUNK; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user