- 论坛徽章:
- 0
|
今天下午没事很么事干.于是在sourceforge上下了tftp服务器和客户端的源码.linux平台上的. 这个代码看的我真是火大.
代码写的简直让人无法阅读... 乱七八糟的缩进. 一行超出整个屏幕.更别说在80个字符以内了.即使再简单.作者也不应该这样来编码.奶奶的熊...
原先还以为是VC的毛病. 换到linux上.用vim来看...依旧如此...不晓得作者用的神马编辑器.
特此来发泄一下不满... 贴上代码片段.- while (1) /* our break statement will escape us when we are done */
- {
- acked = 0;
- ssize = fread (filebuf, 1, datasize, fp);
- if (debug)
- {
- printf
- ("The first data block has been read from the file and will be sent to the server\n");
- printf ("The size read from the file is: %d\n", ssize);
- }
- count++; /* count number of datasize byte portions we read from the file */
- if (count == 1) /* we always look for an ack on the FIRST packet */
- bcount = 0;
- else if (count == 2) /* The second packet will always start our counter at zreo. This special case needs to exist to avoid a DBZ when count = 2 - 2 = 0 */
- bcount = 0;
- else
- bcount = (count - 2) % ackfreq;
复制代码 |
|