#include <stdlib.h>
#endif
-#define READ_BUF_SIZE 10240
-#define WRITE_BUF_SIZE 10240
-#define LINE_BUF_SIZE 2048
+#define READ_BUF_SIZE 128*1024
+#define WRITE_BUF_SIZE 128*1024
+#define LINE_BUF_SIZE 128*1024
static apr_file_t *errfile;
static const char *shortname = "logresolve";
char * stats = NULL;
char * inbuffer;
char * outbuffer;
- char line[LINE_BUF_SIZE];
+ char * line;
int doublelookups = 0;
if (apr_app_initialize(&argc, &argv, NULL) != APR_SUCCESS) {
apr_file_open_stdin(&infile, pool);
/* Allocate two new 10k file buffers */
- if ((outbuffer = apr_palloc(pool, WRITE_BUF_SIZE)) == NULL ||
- (inbuffer = apr_palloc(pool, READ_BUF_SIZE)) == NULL) {
+ if ( (outbuffer = apr_palloc(pool, WRITE_BUF_SIZE)) == NULL
+ || (inbuffer = apr_palloc(pool, READ_BUF_SIZE)) == NULL
+ || (line = apr_palloc(pool, LINE_BUF_SIZE)) == NULL) {
return 1;
}
return 1;
}
- while (apr_file_gets(line, sizeof(line), infile) == APR_SUCCESS) {
+ while (apr_file_gets(line, LINE_BUF_SIZE, infile) == APR_SUCCESS) {
char *hostname;
char *space;
apr_sockaddr_t *ip;