@@ -275,10 +275,10 @@ public String ucAuthcode(String string, String operation, String key, int expiry
275275 }
276276
277277 if (operation .equals ("DECODE" )) {
278- String result = result1 .toString ();
279- try {
280- result = new String (result .getBytes (StandardCharsets .ISO_8859_1 ), StandardCharsets .UTF_8 );
281- }catch (Exception e ) {
278+ String result = result1 .toString ();
279+ try {
280+ result = new String (result .getBytes (StandardCharsets .ISO_8859_1 ), StandardCharsets .UTF_8 );
281+ } catch (Exception e ) {
282282 result = result1 .substring (0 , result1 .length ());
283283 }
284284 if ((Integer .parseInt (substr (result , 0 , 10 )) == 0 || Long .parseLong (substr (result , 0 , 10 )) - time () > 0 ) && substr (result , 10 , 16 ).equals (substr (md5 (substr (result , 26 ) + keyb ), 0 , 16 ))) {
@@ -315,7 +315,7 @@ protected String ucFopen2(String url, int limit, String post, String cookie, boo
315315 }
316316
317317 protected String ucFopen (String url , int limit , String post , String cookie , boolean bysocket , String ip , int timeout , boolean block ) {
318- String returnString = "" ;
318+ StringBuilder returnString = new StringBuilder () ;
319319
320320 URL matches ;
321321 String host = "" ;
@@ -360,6 +360,8 @@ protected String ucFopen(String url, int limit, String post, String cookie, bool
360360 try {
361361 Socket fp = new Socket (ip != null && ip .length () > 10 ? ip : host , port );
362362 if (!fp .isConnected ()) {
363+ System .out .println ("net.renfei.discuz.ucenter.client.Client.ucFopen:\n "
364+ + "Socket Not Connected\n " );
363365 return "" ;//note errstr : errno \r\n
364366 } else {
365367
@@ -369,10 +371,13 @@ protected String ucFopen(String url, int limit, String post, String cookie, bool
369371 InputStream ins = fp .getInputStream ();
370372
371373 BufferedReader reader = new BufferedReader (new InputStreamReader (ins ));
374+ StringBuilder header = new StringBuilder ();
372375 while (true ) {
373- String header = reader .readLine ();
374- if (header == null || header .equals ("" ) || header == "\r \n " || header == "\n " ) {
376+ String data = reader .readLine ();
377+ if (data == null || "" .equals (data ) || "\r \n " . equals ( data ) || "\n " . equals ( data ) ) {
375378 break ;
379+ } else {
380+ header .append (data );
376381 }
377382 }
378383
@@ -381,16 +386,19 @@ protected String ucFopen(String url, int limit, String post, String cookie, bool
381386 if (data == null || data .equals ("" )) {
382387 break ;
383388 } else {
384- returnString += data ;
389+ returnString . append ( data ) ;
385390 }
386391 }
392+ System .out .println ("net.renfei.discuz.ucenter.client.Client.ucFopen:\n "
393+ + header .toString () + "\n \n "
394+ + returnString + "\n " );
387395
388396 fp .close ();
389397 }
390398 } catch (IOException e ) {
391399 e .printStackTrace ();
392400 }
393- return returnString ;
401+ return returnString . toString () ;
394402 }
395403
396404 public String ucAppLs () {
0 commit comments