[jira] Updated: (NET-276) NNTPClient has problems with group listings for large groups.

2011-01-31 Thread Sebb (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb updated NET-276:
-

Component/s: NNTP

> NNTPClient has problems with group listings for large groups.
> -
>
> Key: NET-276
> URL: https://issues.apache.org/jira/browse/NET-276
> Project: Commons Net
>  Issue Type: Bug
>  Components: NNTP
>Affects Versions: 2.0
>Reporter: Erik
> Fix For: 3.0
>
>
> The following command causes a MalformedServerReplyException on my usenet 
> server (astraweb):
> client.listNewsgroups();
> Root Cause:
> Caused by: org.apache.commons.net.MalformedServerReplyException: 
> alt.binaries.boneless 2230918506 1662764743 y
>   at 
> org.apache.commons.net.nntp.NNTPClient.__readNewsgroupListing(NNTPClient.java:255)
>   at 
> org.apache.commons.net.nntp.NNTPClient.listNewsgroups(NNTPClient.java:930)
>   at 
> org.lievaart.jleecher.protocol.CommandFactory$2.doOnServer(CommandFactory.java:27)
>   at 
> org.lievaart.jleecher.protocol.NNTPProtocol.callServer(NNTPProtocol.java:33)
>   ... 2 more
> My hypothesis is that NNTP cannot parse the response, because one of the 
> numbers exceeds the Integer range.
> Locally I have applied the following quick fix to get it to work:
> public class NNTPClient extends NNTP {
> ...
> ...
> ...
>   private NewsgroupInfo __parseNewsgroupListEntry(final String entry) {
>   NewsgroupInfo result;
>   StringTokenizer tokenizer;
>   int lastNum, firstNum;
>   String last, first, permission;
>   result = new NewsgroupInfo();
>   tokenizer = new StringTokenizer(entry);
>   if (tokenizer.countTokens() < 4) {
>   return null;
>   }
>   result._setNewsgroup(tokenizer.nextToken());
>   last = tokenizer.nextToken();
>   first = tokenizer.nextToken();
>   permission = tokenizer.nextToken();
>   try {
>   try {
>   lastNum = Integer.parseInt(last);
>   } catch (NumberFormatException nfe) {
>   if (last.matches("\\d++")) {
>   lastNum = Integer.MAX_VALUE;
>   } else {
>   throw nfe;
>   }
>   }

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (NET-276) NNTPClient has problems with group listings for large groups.

2010-11-08 Thread Sebb (JIRA)

 [ 
https://issues.apache.org/jira/browse/NET-276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb updated NET-276:
-

Fix Version/s: (was: 2.2)
   3.0

> NNTPClient has problems with group listings for large groups.
> -
>
> Key: NET-276
> URL: https://issues.apache.org/jira/browse/NET-276
> Project: Commons Net
>  Issue Type: Bug
>Affects Versions: 2.0
>Reporter: Erik
> Fix For: 3.0
>
>
> The following command causes a MalformedServerReplyException on my usenet 
> server (astraweb):
> client.listNewsgroups();
> Root Cause:
> Caused by: org.apache.commons.net.MalformedServerReplyException: 
> alt.binaries.boneless 2230918506 1662764743 y
>   at 
> org.apache.commons.net.nntp.NNTPClient.__readNewsgroupListing(NNTPClient.java:255)
>   at 
> org.apache.commons.net.nntp.NNTPClient.listNewsgroups(NNTPClient.java:930)
>   at 
> org.lievaart.jleecher.protocol.CommandFactory$2.doOnServer(CommandFactory.java:27)
>   at 
> org.lievaart.jleecher.protocol.NNTPProtocol.callServer(NNTPProtocol.java:33)
>   ... 2 more
> My hypothesis is that NNTP cannot parse the response, because one of the 
> numbers exceeds the Integer range.
> Locally I have applied the following quick fix to get it to work:
> public class NNTPClient extends NNTP {
> ...
> ...
> ...
>   private NewsgroupInfo __parseNewsgroupListEntry(final String entry) {
>   NewsgroupInfo result;
>   StringTokenizer tokenizer;
>   int lastNum, firstNum;
>   String last, first, permission;
>   result = new NewsgroupInfo();
>   tokenizer = new StringTokenizer(entry);
>   if (tokenizer.countTokens() < 4) {
>   return null;
>   }
>   result._setNewsgroup(tokenizer.nextToken());
>   last = tokenizer.nextToken();
>   first = tokenizer.nextToken();
>   permission = tokenizer.nextToken();
>   try {
>   try {
>   lastNum = Integer.parseInt(last);
>   } catch (NumberFormatException nfe) {
>   if (last.matches("\\d++")) {
>   lastNum = Integer.MAX_VALUE;
>   } else {
>   throw nfe;
>   }
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.