diff -ruN inn-2.4.1-maxartsize.ORIG/doc/man/innfeed.conf.5 inn-2.4.1-maxartsize/doc/man/innfeed.conf.5
old
|
new
|
|
459 | 459 | This key requires a positive integer value. It defines the tcp/ip port |
460 | 460 | number to use when connecting to the remote. |
461 | 461 | .TP |
| 462 | .B headers-only |
| 463 | This key requires a boolean value. By default it is set to false. When |
| 464 | set to true, the peer will be sent a headers-only feed. If a Bytes: |
| 465 | header is not present, one will be added with as value the length of the |
| 466 | complete article. This is useful for feeding a diablo server, or an |
| 467 | overview-only INN server. |
| 468 | Note that innfeed should send a MODE HEADFEED command to the peer to |
| 469 | make sure it expects a headers-only feed, and the current code doesn't |
| 470 | do that yet, partly because INN itself doesn't understand it yet so |
| 471 | it would be impossible to feed a headers-only feed to INN. |
| 472 | Make sure that you |
| 473 | .I never |
| 474 | .I ever |
| 475 | send a headers-only feed to a peer that also receives a normal feed! |
| 476 | .TP |
462 | 477 | .B drop-deferred |
463 | 478 | This key requires a boolean value. By default it is set to false. When |
464 | 479 | set to true, and a peer replies with code 431 or 436 (try again later) just |
Binary files inn-2.4.1-maxartsize.ORIG/innfeed/.article.c.swp and inn-2.4.1-maxartsize/innfeed/.article.c.swp differ
diff -ruN inn-2.4.1-maxartsize.ORIG/innfeed/article.c inn-2.4.1-maxartsize/innfeed/article.c
old
|
new
|
|
53 | 53 | char *fname ; /* the file name of the article */ |
54 | 54 | char *msgid ; /* the msgid of the article (INN tells us) */ |
55 | 55 | Buffer contents ; /* the buffer of the actual on disk stuff */ |
| 56 | Buffer headers ; /* the buffer of just the headers */ |
56 | 57 | Buffer *nntpBuffers ; /* list of buffers for transmisson */ |
| 58 | Buffer *nntpHeaderBuffers ; /* list of header buffers for transmission */ |
57 | 59 | const void *mMapping ; /* base of memory mapping, or NULL if none */ |
58 | 60 | bool loggedMissing ; /* true if article is missing and we logged */ |
59 | 61 | bool articleOk ; /* true until we know otherwise. */ |
… |
… |
|
76 | 78 | * Private functions |
77 | 79 | */ |
78 | 80 | |
79 | | static Buffer artGetContents (Article article) ; /* Return the buffer that |
80 | | fillContents() filled |
81 | | up. */ |
| 81 | /* Return the buffer that fillContents() filled up. */ |
| 82 | static Buffer artGetContents (Article article, bool headersOnly) ; |
82 | 83 | |
83 | 84 | /* Log statistics on article memory usage. */ |
84 | 85 | static void logArticleStats (TimeoutId id, void *data) ; |
85 | 86 | |
86 | | static bool fillContents (Article article) ; /* Read the article's bits |
87 | | off the disk. */ |
| 87 | /* Read the article's bits off the disk. */ |
| 88 | static bool fillContents (Article article, bool HeadersOnly) ; |
88 | 89 | |
89 | 90 | /* Append buffer B to the buffer array BUFFS. */ |
90 | 91 | static void appendBuffer (Buffer b, Buffer **buffs, int *newSpot, int *curLen); |
91 | 92 | |
92 | | static bool prepareArticleForNNTP (Article article) ; /* Do the necessary |
93 | | CR-LF stuff */ |
| 93 | /* Do the necessary CR-LF stuff */ |
| 94 | static bool prepareArticleForNNTP (Article article, bool headersOnly) ; |
94 | 95 | |
95 | 96 | static bool artFreeContents (Article art) ; /* Tell the Article to release |
96 | 97 | its contents buffer if |
… |
… |
|
108 | 109 | static unsigned int hashString (const char *string) ; |
109 | 110 | |
110 | 111 | /* Locates the article with the given message ID, in the has table. */ |
111 | | static Article hashFindArticle (const char *msgid) ; |
| 112 | static Article hashFindArticle (const char *msgid); |
112 | 113 | |
113 | 114 | /* Puts the given article in the hash table. */ |
114 | 115 | static void hashAddArticle (Article article) ; |
… |
… |
|
184 | 185 | Article newArticle (const char *filename, const char *msgid) |
185 | 186 | { |
186 | 187 | Article newArt = NULL ; |
187 | | |
| 188 | |
188 | 189 | TMRstart(TMR_NEWARTICLE); |
189 | 190 | if (hashTable == NULL) |
190 | 191 | { /* first-time through initialization. */ |
… |
… |
|
212 | 213 | newArt->msgid = xstrdup (msgid) ; |
213 | 214 | |
214 | 215 | newArt->contents = NULL ; |
| 216 | newArt->headers = NULL ; |
215 | 217 | newArt->mMapping = NULL ; |
216 | 218 | newArt->refCount = 1 ; |
217 | 219 | newArt->loggedMissing = false ; |
… |
… |
|
235 | 237 | newArt->refCount++ ; |
236 | 238 | d_printf (2,"Reusing existing article for %s\nx",msgid) ; |
237 | 239 | } |
| 240 | |
238 | 241 | TMRstop(TMR_NEWARTICLE); |
239 | 242 | return newArt ; |
240 | 243 | } |
… |
… |
|
268 | 271 | if (article->nntpBuffers != NULL) |
269 | 272 | freeBufferArray (article->nntpBuffers) ; |
270 | 273 | |
| 274 | if (article->nntpHeaderBuffers != NULL) |
| 275 | freeBufferArray (article->nntpHeaderBuffers) ; |
| 276 | |
| 277 | if (article->headers) { |
| 278 | if (article->contents != article->headers) |
| 279 | bytesInUse -= bufferDataSize (article->headers) ; |
| 280 | delBuffer (article->headers) ; |
| 281 | } |
| 282 | |
271 | 283 | delBuffer (article->contents) ; |
272 | 284 | } |
273 | 285 | |
… |
… |
|
360 | 372 | } |
361 | 373 | |
362 | 374 | /* return true if we have or are able to get the contents off the disk */ |
363 | | bool artContentsOk (Article article) |
| 375 | bool artContentsOk (Article article, bool headersOnly) |
364 | 376 | { |
365 | 377 | bool rval = false ; |
366 | 378 | |
367 | | if ( prepareArticleForNNTP (article) ) |
| 379 | if ( prepareArticleForNNTP (article, headersOnly) ) |
368 | 380 | rval = true ; |
369 | 381 | |
370 | 382 | return rval ; |
… |
… |
|
393 | 405 | |
394 | 406 | /* Get a NULL terminated array of Buffers that is ready for sending via NNTP */ |
395 | 407 | |
396 | | Buffer *artGetNntpBuffers (Article article) |
| 408 | Buffer *artGetNntpBuffers (Article article, bool headersOnly) |
397 | 409 | { |
398 | | if ( !prepareArticleForNNTP (article) ) |
| 410 | if ( !prepareArticleForNNTP (article, headersOnly) ) |
399 | 411 | return NULL ; |
400 | 412 | |
401 | | return dupBufferArray (article->nntpBuffers) ; |
| 413 | return dupBufferArray (headersOnly ? article->nntpHeaderBuffers : |
| 414 | article->nntpBuffers) ; |
402 | 415 | } |
403 | 416 | |
404 | 417 | |
… |
… |
|
409 | 422 | } |
410 | 423 | |
411 | 424 | /* return size of the article */ |
412 | | int artSize (Article article) |
| 425 | int artSize (Article article, bool headersOnly) |
413 | 426 | { |
414 | 427 | if (article == NULL || article->contents == NULL) |
415 | 428 | return (int)0 ; |
| 429 | if (headersOnly && article->headers == NULL) |
| 430 | return (int)0; |
416 | 431 | return (int)bufferDataSize(article->contents); |
417 | 432 | } |
418 | 433 | |
419 | 434 | |
420 | 435 | /* return how many NNTP-ready buffers the article contains */ |
421 | | unsigned int artNntpBufferCount (Article article) |
| 436 | unsigned int artNntpBufferCount (Article article, bool headersOnly) |
422 | 437 | { |
423 | | if ( !prepareArticleForNNTP (article) ) |
| 438 | if ( !prepareArticleForNNTP (article, headersOnly) ) |
424 | 439 | return 0 ; |
425 | 440 | |
426 | | return bufferArrayLen (article->nntpBuffers) ; |
| 441 | return bufferArrayLen (headersOnly ? article->nntpHeaderBuffers : |
| 442 | article->nntpBuffers) ; |
427 | 443 | } |
428 | 444 | |
429 | 445 | |
… |
… |
|
451 | 467 | |
452 | 468 | /* return a single buffer that contains the disk image of the article (i.e. |
453 | 469 | not fixed up for NNTP). */ |
454 | | static Buffer artGetContents (Article article) |
| 470 | static Buffer artGetContents (Article article, bool headersOnly) |
455 | 471 | { |
456 | 472 | Buffer rval = NULL ; |
457 | 473 | |
458 | 474 | if (article->articleOk) |
459 | 475 | { |
460 | 476 | if (article->contents == NULL) |
461 | | fillContents (article) ; |
| 477 | fillContents (article, headersOnly) ; |
462 | 478 | |
463 | 479 | if (article->contents != NULL) |
464 | | rval = bufferTakeRef (article->contents) ; |
| 480 | rval = bufferTakeRef (headersOnly ? article->headers : |
| 481 | article->contents) ; |
465 | 482 | } |
466 | 483 | |
467 | 484 | return rval ; |
… |
… |
|
495 | 512 | articleStatsId = prepareSleep (logArticleStats,ARTICLE_STATS_PERIOD,0) ; |
496 | 513 | } |
497 | 514 | |
| 515 | /* Find the start of the body, and check if there's a Bytes: header. |
| 516 | body will point to the empty line between header and body. */ |
| 517 | static void findBody (char *data, size_t size, bool inWireFormat, |
| 518 | char **body, char **bytes, char *control) |
| 519 | { |
| 520 | char *p; |
| 521 | int nlseen = 1; |
| 522 | |
| 523 | *bytes = NULL; |
| 524 | *control = NULL; |
| 525 | *body = NULL; |
| 526 | if (inWireFormat) size--; |
| 527 | |
| 528 | for (p = data; p < data + size; p++) { |
| 529 | |
| 530 | if (nlseen && (*p == 'b' || *p == 'B') && |
| 531 | p < data + size - 6 && |
| 532 | strncasecmp(p, "Bytes:", 6) == 0) |
| 533 | *bytes = p; |
| 534 | |
| 535 | if (nlseen && (*p == 'c' || *p == 'C') && |
| 536 | p < data + size - 8 && |
| 537 | strncasecmp(p, "Control:", 8) == 0) |
| 538 | *control = p; |
| 539 | |
| 540 | if (inWireFormat) { |
| 541 | if (*p != '\r' && *(p+1) == '\n') { |
| 542 | p++; |
| 543 | continue; |
| 544 | } |
| 545 | if (*p == '\r' && *(p+1) == '\n') |
| 546 | p++; |
| 547 | } |
| 548 | |
| 549 | if (*p == '\n') { |
| 550 | if (nlseen) { |
| 551 | *body = p - (inWireFormat ? 1 : 0); |
| 552 | break; |
| 553 | } |
| 554 | nlseen = 1; |
| 555 | } else |
| 556 | nlseen = 0; |
| 557 | } |
| 558 | |
| 559 | if (*bytes == NULL) *bytes = p; |
| 560 | } |
| 561 | |
498 | 562 | |
499 | 563 | /* do the actual read of the article off disk into a Buffer that is stored |
500 | 564 | in the Article object. The Article will end up with its contents field |
… |
… |
|
504 | 568 | contents may be copied around after reading to insert a carriage |
505 | 569 | return before each newline. */ |
506 | 570 | |
507 | | static bool fillContents (Article article) |
| 571 | static bool fillContents (Article article, bool headersOnly) |
508 | 572 | { |
| 573 | Buffer body; |
509 | 574 | int fd = -1; |
510 | | char *p; |
| 575 | char *p, *b; |
511 | 576 | static bool maxLimitNotified ; |
512 | 577 | bool opened; |
513 | 578 | size_t articlesize = 0; |
| 579 | size_t bytes, hdrsize; |
514 | 580 | char *buffer = NULL ; |
515 | 581 | int amt = 0 ; |
516 | 582 | size_t idx = 0, amtToRead ; |
… |
… |
|
721 | 787 | } |
722 | 788 | } |
723 | 789 | |
724 | | |
| 790 | /* In header-only mode we need to replace article->contents with |
| 791 | * a buffer with just the headers, followed by a Bytes: header. */ |
| 792 | if (article->articleOk && article->contents && headersOnly) { |
| 793 | |
| 794 | bytes = bufferDataSize (article->contents); |
| 795 | buffer = bufferBase (article->contents); |
| 796 | |
| 797 | findBody(buffer, bytes, article->inWireFormat, &p, &bHdr, &cHdr); |
| 798 | |
| 799 | if (cHdr) |
| 800 | article->headers = bufferTakeRef (article->contents) ; |
| 801 | else if ((article->headers = newBuffer (hdrsize + 24)) != NULL) { |
| 802 | p = bufferBase(article->headers); |
| 803 | memcpy(p, buffer, hdrsize); |
| 804 | if (bHdr == NULL) |
| 805 | hdrsize += sprintf(p + hdrsize, "Bytes: %d", bytes); |
| 806 | hdrsize += sprintf(p + hdrsize, "%s", |
| 807 | article->inWireFormat ? "\r\n\r\n" : "\n\n"); |
| 808 | bufferSetDataSize (article->headers, hdrsize) ; |
| 809 | bytesInUse += hdrsize; |
| 810 | byteTotal += hdrsize; |
| 811 | } else |
| 812 | warn ("ME internal failed to build headfeed buffer") ; |
| 813 | } |
| 814 | |
725 | 815 | /* If we're not useing storage api, we should close a valid file descriptor */ |
726 | 816 | if (!article->arthandle && (fd >= 0)) |
727 | 817 | close (fd) ; |
728 | 818 | |
729 | 819 | TMRstop(TMR_READART); |
730 | | return (article->contents != NULL ? true : false) ; |
| 820 | return ((headersOnly ? article->headers : article->contents) != NULL ? |
| 821 | true : false) ; |
731 | 822 | } |
732 | 823 | |
733 | 824 | |
… |
… |
|
751 | 842 | /* Takes the articles contents buffer and overlays a set of new buffers on |
752 | 843 | top of it. These buffers insert the required carriage return and dot |
753 | 844 | characters as needed */ |
754 | | static bool prepareArticleForNNTP (Article article) |
| 845 | static bool prepareArticleForNNTP (Article article, bool headersOnly) |
755 | 846 | { |
756 | 847 | static Buffer dotFirstBuffer ; |
757 | 848 | static Buffer dotBuffer ; |
… |
… |
|
762 | 853 | char *start, *end ; |
763 | 854 | Buffer contents ; |
764 | 855 | |
765 | | contents = artGetContents (article) ; /* returns a reference */ |
| 856 | contents = artGetContents (article, headersOnly) ; /* returns a reference */ |
766 | 857 | |
767 | 858 | TMRstart(TMR_PREPART); |
768 | 859 | if (contents == NULL) { |
769 | 860 | TMRstop(TMR_PREPART); |
770 | 861 | return false ; |
771 | 862 | } |
772 | | else if (article->nntpBuffers != NULL) |
| 863 | else if ((!headersOnly && article->nntpBuffers != NULL) || |
| 864 | ( headersOnly && article->nntpHeaderBuffers != NULL)) |
773 | 865 | { |
774 | 866 | delBuffer (contents) ; |
775 | 867 | TMRstop(TMR_PREPART); |
… |
… |
|
821 | 913 | |
822 | 914 | |
823 | 915 | delBuffer (contents) ; /* the article is still holding a reference */ |
824 | | article->nntpBuffers = nntpBuffs ; |
| 916 | if (headersOnly) |
| 917 | article->nntpHeaderBuffers = nntpBuffs ; |
| 918 | else |
| 919 | article->nntpBuffers = nntpBuffs ; |
825 | 920 | TMRstop(TMR_PREPART); |
826 | 921 | return true ; |
827 | 922 | } |
… |
… |
|
845 | 940 | } |
846 | 941 | } |
847 | 942 | |
| 943 | if (art->nntpHeaderBuffers != NULL) |
| 944 | { |
| 945 | if (bufferRefCount (art->nntpHeaderBuffers[0]) > 1) |
| 946 | return false ; |
| 947 | else |
| 948 | { |
| 949 | freeBufferArray (art->nntpHeaderBuffers) ; |
| 950 | art->nntpHeaderBuffers = NULL ; |
| 951 | } |
| 952 | } |
| 953 | |
848 | 954 | ASSERT (bufferRefCount (art->contents) == 1) ; |
849 | 955 | |
850 | 956 | if (art->mMapping) |
… |
… |
|
853 | 959 | bytesInUse -= bufferDataSize (art->contents) ; |
854 | 960 | |
855 | 961 | delBuffer (art->contents) ; |
856 | | |
857 | 962 | art->contents = NULL ; |
| 963 | |
| 964 | if (art->headers) delBuffer (art->headers) ; |
| 965 | art->headers = NULL ; |
858 | 966 | |
859 | 967 | return true ; |
860 | 968 | } |
diff -ruN inn-2.4.1-maxartsize.ORIG/innfeed/article.h inn-2.4.1-maxartsize/innfeed/article.h
old
|
new
|
|
44 | 44 | |
45 | 45 | /* return true if we have the article's contents (calling this may trigger |
46 | 46 | the reading off the disk). */ |
47 | | bool artContentsOk (Article article) ; |
| 47 | bool artContentsOk (Article article, bool headersOnly) ; |
48 | 48 | |
49 | 49 | /* increments reference count and returns a copy of article that can be |
50 | 50 | kept (or passed off to someone else) */ |
… |
… |
|
55 | 55 | |
56 | 56 | /* return a list of buffers suitable for giving to an endpoint. The return |
57 | 57 | value can (must) be given to freeBufferArray */ |
58 | | Buffer *artGetNntpBuffers (Article article) ; |
| 58 | Buffer *artGetNntpBuffers (Article article, bool headersOnly) ; |
59 | 59 | |
60 | 60 | /* return the message id stoed in the article object */ |
61 | 61 | const char *artMsgId (Article article) ; |
62 | 62 | |
63 | 63 | /* return size of the article */ |
64 | | int artSize (Article article) ; |
| 64 | int artSize (Article article, bool headersOnly) ; |
65 | 65 | |
66 | 66 | /* return the number of buffers that artGetNntpBuffers() would return. */ |
67 | | unsigned int artNntpBufferCount (Article article) ; |
| 67 | unsigned int artNntpBufferCount (Article article, bool headersOnly) ; |
68 | 68 | |
69 | 69 | /* tell the Article class to log (or not) missing articles as they occur. */ |
70 | 70 | void artLogMissingArticles (bool val) ; |
diff -ruN inn-2.4.1-maxartsize.ORIG/innfeed/connection.c inn-2.4.1-maxartsize/innfeed/connection.c
old
|
new
|
|
3062 | 3062 | else |
3063 | 3063 | { |
3064 | 3064 | cxn->takesOkayed++ ; |
3065 | | cxn->takesSizeOkayed += artSize(artHolder->article); |
| 3065 | cxn->takesSizeOkayed += artSize(artHolder->article, hostHeadersOnly(cxn->myHost)); |
3066 | 3066 | |
3067 | 3067 | remArtHolder (artHolder, &cxn->takeRespHead, &cxn->articleQTotal) ; |
3068 | 3068 | if (cxn->articleQTotal == 0) |
… |
… |
|
3172 | 3172 | else |
3173 | 3173 | { |
3174 | 3174 | cxn->takesRejected++ ; |
3175 | | cxn->takesSizeRejected += artSize(artHolder->article); |
| 3175 | cxn->takesSizeRejected += artSize(artHolder->article, hostHeadersOnly(cxn->myHost)); |
3176 | 3176 | |
3177 | 3177 | remArtHolder (artHolder, &cxn->takeRespHead, &cxn->articleQTotal) ; |
3178 | 3178 | /* Some(?) hosts return the 439 response even before we're done |
… |
… |
|
3238 | 3238 | cxn->takeRespHead = NULL ; |
3239 | 3239 | cxn->articleQTotal = 0 ; |
3240 | 3240 | cxn->takesOkayed++ ; |
3241 | | cxn->takesSizeOkayed += artSize(artHolder->article); |
| 3241 | cxn->takesSizeOkayed += artSize(artHolder->article, hostHeadersOnly(cxn->myHost)); |
3242 | 3242 | |
3243 | 3243 | if (cxn->articleQTotal == 0) |
3244 | 3244 | cxnIdle (cxn) ; |
… |
… |
|
3513 | 3513 | |
3514 | 3514 | artHolder = cxn->takeRespHead ; |
3515 | 3515 | cxn->takeRespHead = NULL ; |
3516 | | cxn->takesSizeRejected += artSize(artHolder->article); |
| 3516 | cxn->takesSizeRejected += artSize(artHolder->article, hostHeadersOnly(cxn->myHost)); |
3517 | 3517 | |
3518 | 3518 | /* Some servers return the 437 response before we're done sending. */ |
3519 | 3519 | if (cxn->articleQTotal == 0 && !writeIsPending (cxn->myEp)) |
… |
… |
|
4050 | 4050 | ASSERT (article != NULL) ; |
4051 | 4051 | |
4052 | 4052 | if (cxn->state != cxnClosingS) |
4053 | | writeArray = artGetNntpBuffers (article) ; |
| 4053 | writeArray = artGetNntpBuffers (article, hostHeadersOnly(cxn->myHost)) ; |
4054 | 4054 | else |
4055 | 4055 | writeArray = NULL ; |
4056 | 4056 | |
… |
… |
|
4266 | 4266 | /* count up all the buffers we'll be writing. One extra each time for |
4267 | 4267 | the TAKETHIS command buffer*/ |
4268 | 4268 | for (p = cxn->takeHead ; p != NULL ; p = p->next) |
4269 | | if (artContentsOk (p->article)) |
4270 | | lenArray += (1 + artNntpBufferCount (p->article)) ; |
| 4269 | if (artContentsOk (p->article, hostHeadersOnly(cxn->myHost))) |
| 4270 | lenArray += (1 + artNntpBufferCount (p->article, hostHeadersOnly(cxn->myHost))) ; |
4271 | 4271 | |
4272 | 4272 | /* now allocate the array for the buffers and put them all in it */ |
4273 | 4273 | /* 1 for the terminator */ |
… |
… |
|
4287 | 4287 | int i, nntpLen ; |
4288 | 4288 | |
4289 | 4289 | article = p->article ; |
4290 | | nntpLen = artNntpBufferCount (article) ; |
| 4290 | nntpLen = artNntpBufferCount (article, hostHeadersOnly(cxn->myHost)) ; |
4291 | 4291 | msgid = artMsgId (article) ; |
4292 | 4292 | |
4293 | 4293 | if (nntpLen == 0) |
… |
… |
|
4308 | 4308 | } |
4309 | 4309 | else |
4310 | 4310 | { |
4311 | | articleBuffers = artGetNntpBuffers (article) ; |
| 4311 | articleBuffers = artGetNntpBuffers (article, hostHeadersOnly(cxn->myHost)) ; |
4312 | 4312 | |
4313 | 4313 | /* set up the buffer with the TAKETHIS command in it. |
4314 | 4314 | 12 == strlen ("TAKETHIS \n\r") */ |
diff -ruN inn-2.4.1-maxartsize.ORIG/innfeed/host.c inn-2.4.1-maxartsize/innfeed/host.c
old
|
new
|
|
93 | 93 | unsigned int closePeriod; |
94 | 94 | unsigned int dynamicMethod; |
95 | 95 | bool wantStreaming; |
| 96 | bool headersOnly; |
96 | 97 | bool dropDeferred; |
97 | 98 | bool minQueueCxn; |
98 | 99 | double lowPassLow; /* as percentages */ |
… |
… |
|
504 | 505 | params->closePeriod=CLOSE_PERIOD; |
505 | 506 | params->dynamicMethod=METHOD_STATIC; |
506 | 507 | params->wantStreaming=STREAM; |
| 508 | params->headersOnly=false; |
507 | 509 | params->dropDeferred=false; |
508 | 510 | params->minQueueCxn=false; |
509 | 511 | params->lowPassLow=NOCHECKLOW; |
… |
… |
|
1286 | 1288 | host->params->initialConnections) ; |
1287 | 1289 | fprintf (fp,"%s want-streaming : %s\n",indent, |
1288 | 1290 | boolToString (host->params->wantStreaming)) ; |
| 1291 | fprintf (fp,"%s headers-only : %s\n",indent, |
| 1292 | boolToString (host->params->headersOnly)) ; |
1289 | 1293 | fprintf (fp,"%s drop-deferred : %s\n",indent, |
1290 | 1294 | boolToString (host->params->dropDeferred)) ; |
1291 | 1295 | fprintf (fp,"%s min-queue-connection : %s\n",indent, |
… |
… |
|
2128 | 2132 | { |
2129 | 2133 | const char *filename = artFileName (article) ; |
2130 | 2134 | const char *msgid = artMsgId (article) ; |
2131 | | double len = artSize (article); |
| 2135 | double len = artSize (article, false); |
2132 | 2136 | |
2133 | 2137 | d_printf (5,"Article %s (%s) was transferred\n", msgid, filename) ; |
2134 | 2138 | |
… |
… |
|
2191 | 2195 | { |
2192 | 2196 | const char *filename = artFileName (article) ; |
2193 | 2197 | const char *msgid = artMsgId (article) ; |
2194 | | double len = artSize (article); |
| 2198 | double len = artSize (article, false); |
2195 | 2199 | |
2196 | 2200 | d_printf (5,"Article %s (%s) was rejected\n", msgid, filename) ; |
2197 | 2201 | |
… |
… |
|
2451 | 2455 | return host->params->wantStreaming ; |
2452 | 2456 | } |
2453 | 2457 | |
| 2458 | bool hostHeadersOnly (Host host) |
| 2459 | { |
| 2460 | return host->params->headersOnly ; |
| 2461 | } |
| 2462 | |
2454 | 2463 | unsigned int hostMaxChecks (Host host) |
2455 | 2464 | { |
2456 | 2465 | return host->params->maxChecks ; |
… |
… |
|
2671 | 2680 | GETINT(s,fp,"max-connections",0,LONG_MAX,REQ,p->absMaxConnections, inherit); |
2672 | 2681 | GETINT(s,fp,"max-queue-size",1,LONG_MAX,REQ,p->maxChecks, inherit); |
2673 | 2682 | GETBOOL(s,fp,"streaming",REQ,p->wantStreaming, inherit); |
| 2683 | GETBOOL(s,fp,"headers-only",REQ,p->headersOnly, inherit); |
2674 | 2684 | GETBOOL(s,fp,"drop-deferred",REQ,p->dropDeferred, inherit); |
2675 | 2685 | GETBOOL(s,fp,"min-queue-connection",REQ,p->minQueueCxn, inherit); |
2676 | 2686 | GETREAL(s,fp,"no-check-high",0.0,100.0,REQ,p->lowPassHigh, inherit); |
diff -ruN inn-2.4.1-maxartsize.ORIG/innfeed/host.h inn-2.4.1-maxartsize/innfeed/host.h
old
|
new
|
|
173 | 173 | /* return maxChecks */ |
174 | 174 | unsigned int hostmaxChecks (Host host); |
175 | 175 | |
| 176 | /* return whether or not we're sending a headers-only feed */ |
| 177 | bool hostHeadersOnly (Host host); |
| 178 | |
176 | 179 | /* return if we should drop deferred articles */ |
177 | 180 | bool hostDropDeferred (Host host); |
178 | 181 | |
diff -ruN inn-2.4.1-maxartsize.ORIG/innfeed/imap_connection.c inn-2.4.1-maxartsize/innfeed/imap_connection.c
old
|
new
|
|
1045 | 1045 | int t; |
1046 | 1046 | |
1047 | 1047 | /* make sure contents ok; this also should load it into memory */ |
1048 | | if (!artContentsOk (art)) { |
| 1048 | if (!artContentsOk (art, false)) { |
1049 | 1049 | d_printf(0, "%s:%d AddControlMsg(): " |
1050 | 1050 | "artContentsOk() said article was bad\n", |
1051 | 1051 | hostPeerName (cxn->myHost), cxn->ident); |
… |
… |
|
3897 | 3897 | } |
3898 | 3898 | |
3899 | 3899 | /* make sure contents ok; this also should load it into memory */ |
3900 | | res = artContentsOk (item->data.article); |
| 3900 | res = artContentsOk (item->data.article, false); |
3901 | 3901 | if (res==false) |
3902 | 3902 | { |
3903 | 3903 | if (justadded == item->data.article) { |
… |
… |
|
3912 | 3912 | } |
3913 | 3913 | |
3914 | 3914 | /* Check if it's a control message */ |
3915 | | bufs = artGetNntpBuffers (item->data.article); |
| 3915 | bufs = artGetNntpBuffers (item->data.article, false); |
3916 | 3916 | if (bufs == NULL) |
3917 | 3917 | { |
3918 | 3918 | /* tell to reject taking this message */ |