Capsd fails to detect some HTTP servers

Description

HttpPlugin fails to detect an HTTP server if the HTTP server does not finish the
content with a newline. B/c HttpPlugin.java uses a readLn call, the IO does not
complete since a newline is not found. The readLn call eventually throws a
SocketTimeout exception, which is caught as an InterruptedIOException in
AbstractTCPPlugin. The soon-to-be attached patch fixes the issue.

Environment

Operating System: All Platform: All

Acceptance / Success Criteria

None

Attachments

1

Lucidchart Diagrams

Activity

Show:

Tarus Balog August 3, 2005 at 6:29 PM

Thanks for this. It'll be in 1.2.4.

Oh, in the future can you submit unified diffs? Makes it easier to patch.

Former user April 5, 2005 at 8:14 PM

Here's another patch you can consider applying Tarus

Tobey Pasheilich April 5, 2005 at 2:03 PM

Created an attachment (id=195)
Patch for Http Servers which do not end their content with a newline

The patch replaces calls to readLn() with equivilant calls to read(), and
handles the SocketTimeout exception.

A breif scan of HttpMonitor.java shows that readLn is used there also, so it's
reasonable to update that with read() also. However, it appears that
HttpMonitor may only be affected IFF configured to attempt to match the
response (AND the webserver does not newline terminate the content.)

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created April 5, 2005 at 1:59 PM
Updated January 27, 2017 at 4:31 PM
Resolved August 3, 2005 at 7:29 PM