[bug?] expect in bb-services should set banner automagically
list Charles Goyard
Hi Henrik, I just lost 2 hours because I failed to set the "banner" option when expecting a response from an ajp13 service in tomcat. Won't it be nice to have an "auto banner ON" when expecting some feedback from the server ? By the way, here is the protocol to test AJP 1.3 : [ajp13] send "\x12\x34\x00\x01\x0a" expect "\x41\x42\x00\x01\x09" options banner port 8009 (sends a PING command) Regards, -- Charles
list Henrik Størner
▸
On Fri, Jul 07, 2006 at 05:12:07PM +0200, Charles Goyard wrote:
I just lost 2 hours because I failed to set the "banner" option when expecting a response from an ajp13 service in tomcat. Won't it be nice to have an "auto banner ON" when expecting some feedback from the server ?
No, I don't think so. Some of the data you get back might very well be binary that you don't want to display. Another reason is that if you auto-enable something, then there has to be a way of explicitly DISabling it. So doing what you ask would mean I would have to also enable a "nobanner" option.
▸
By the way, here is the protocol to test AJP 1.3 : [ajp13] send "\x12\x34\x00\x01\x0a" expect "\x41\x42\x00\x01\x09" options banner port 8009 (sends a PING command)
Thanks, added to the default bb-services file. Regards, Henrik
Regards, -- Charles
-- Henrik Storner
list Charles Goyard
▸
Henrik Stoerner a écrit :
Won't it be nice to have an "auto banner ON" when expecting some feedback from the server ?No, I don't think so. Some of the data you get back might very well be binary that you don't want to display.
That is, when I drop the banner option, all my ajp13 tests go yellow
saying "Unexpected service response". As soon as I put the banner option
back, they turn green.
It that case, I get binary data I don't want to display, but omitting
the banner options fails :
2006-07-10 09:29:25 Adding to combo msg: status mywonderfultomcat.ajp13 yellow
<!-- [flags:OrdastLe] --> Mon Jul 10 09:28:21 2006 ajp13 NOT ok
2006-07-10 09:29:25 tcp_got_expected: No data in banner
This is why I suspect a bug, or at least a misfeature ;)
Regard,
--
Charles
list Henrik Størner
▸
On Mon, Jul 10, 2006 at 09:32:47AM +0200, Charles Goyard wrote:
Henrik Stoerner a écrit :Won't it be nice to have an "auto banner ON" when expecting some feedback from the server ?No, I don't think so. Some of the data you get back might very well be binary that you don't want to display.That is, when I drop the banner option, all my ajp13 tests go yellow saying "Unexpected service response". As soon as I put the banner option back, they turn green. It that case, I get binary data I don't want to display, but omitting the banner options fails : 2006-07-10 09:29:25 Adding to combo msg: status mywonderfultomcat.ajp13 yellow <!-- [flags:OrdastLe] --> Mon Jul 10 09:28:21 2006 ajp13 NOT ok 2006-07-10 09:29:25 tcp_got_expected: No data in banner This is why I suspect a bug, or at least a misfeature ;)
OK, I see now. Could you try if the attached patch solves this problem?
Regards,
Henrik
-------------- next part --------------
--- bbnet/contest.c 2006/05/03 21:12:33 1.85
+++ bbnet/contest.c 2006/07/10 08:37:45
@@ -1014,9 +1014,12 @@
* If we have anything to send then send it.
* If we want the banner, set the "readpending" flag to initiate
* select() for read()'s.
+ * NB: We want the banner EITHER if the GET_BANNER flag is set,
+ * OR if we need it to match the expect string in the servicedef.
*/
- item->readpending = (do_talk && !item->silenttest && (item->svcinfo->flags & TCP_GET_BANNER));
+ item->readpending = (do_talk && !item->silenttest &&
+ ( (item->svcinfo->flags & TCP_GET_BANNER) || item->svcinfo->exptext ));
if (do_talk) {
if (item->telnetnegotiate && item->telnetbuflen) {
/*
list Charles Goyard
▸
Henrik Stoerner a écrit :
On Mon, Jul 10, 2006 at 09:32:47AM +0200, Charles Goyard wrote:Henrik Stoerner a écrit :This is why I suspect a bug, or at least a misfeature ;)OK, I see now. Could you try if the attached patch solves this problem?
Well, it just _works_. Thanks a lot Henrik ! -- Charles (hey boss, seen this : free software !)