Subversion Repositories Tewi

Rev

Rev 393 | Rev 395 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 393 Rev 394
Line 1... Line 1...
1
/* $Id: server.c 393 2024-10-27 23:53:30Z nishi $ */
1
/* $Id: server.c 394 2024-10-27 23:55:11Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 343... Line 343...
343
	incr = 0;
343
	incr = 0;
344
	while(1) {
344
	while(1) {
345
		if(f != NULL) {
345
		if(f != NULL) {
346
			char buffer[512];
346
			char buffer[512];
347
			fread(buffer, size < 512 ? size : 512, 1, f);
347
			fread(buffer, size < 512 ? size : 512, 1, f);
348
			tw_write(ssl, sock, buffer, size < 512 ? size : 512);
348
			if(tw_write(ssl, sock, buffer, size < 512 ? size : 512) < 0) return;
349
		} else {
349
		} else {
350
			tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512);
350
			if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) < 0) return;
351
		}
351
		}
352
		incr += 512;
352
		incr += 512;
353
		if(size <= 512) break;
353
		if(size <= 512) break;
354
		size -= 512;
354
		size -= 512;
355
	}
355
	}