improve formating
This commit is contained in:
parent
701908d016
commit
7a7b6feb60
|
|
@ -385,20 +385,21 @@ void serve_file (struct sockaddr_in * from, UBUF * ub, FILE * fp,
|
||||||
unsigned long pos;
|
unsigned long pos;
|
||||||
|
|
||||||
if(has_len == 2) { /* recover length field if it exists */
|
if(has_len == 2) { /* recover length field if it exists */
|
||||||
len=lp[0] << 8;
|
len = lp[0] << 8;
|
||||||
len = len + lp[1];
|
len = len + lp[1];
|
||||||
if(len > packetsize )
|
if(len > packetsize ) {
|
||||||
len = packetsize;
|
len = packetsize;
|
||||||
else
|
} else if(len <= 0) {
|
||||||
if(len <= 0)
|
|
||||||
len = UBUF_SPACE;
|
len = UBUF_SPACE;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
/* use default if it doesn't exist */
|
/* use default length because length is not included in request */
|
||||||
len = packetsize;
|
len = packetsize;
|
||||||
if( len > UBUF_SPACE )
|
if( len > UBUF_SPACE ) {
|
||||||
len = UBUF_SPACE;
|
len = UBUF_SPACE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pos = BB_READ4(ub->bb_pos);
|
pos = BB_READ4(ub->bb_pos);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user