← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21955: Bug fix in HttpGateway

 

------------------------------------------------------------
revno: 21955
committer: Zubair Asghar<zubair@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-02-12 12:29:05 +0100
message:
  Bug fix in HttpGateway
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/AdvanceHttpPostGateWay.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/SimplisticHttpGetGateWay.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/AdvanceHttpPostGateWay.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/AdvanceHttpPostGateWay.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/AdvanceHttpPostGateWay.java	2016-02-12 11:29:05 +0000
@@ -117,7 +117,9 @@
 
                 HttpURLConnection httpConnection = (HttpURLConnection) conn;
 
-                if ( httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK )
+                if ( httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK
+                    && httpConnection.getResponseCode() != HttpURLConnection.HTTP_ACCEPTED
+                    && httpConnection.getResponseCode() != HttpURLConnection.HTTP_CREATED )
                 {
                     log.warn( "Couldn't send message, got response " + response + " " + getGatewayId() );
                     return 0;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/SimplisticHttpGetGateWay.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/SimplisticHttpGetGateWay.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/config/SimplisticHttpGetGateWay.java	2016-02-12 11:29:05 +0000
@@ -161,7 +161,9 @@
 
             HttpURLConnection httpConnection = (HttpURLConnection) conn;
 
-            if ( httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK )
+            if ( httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK
+                && httpConnection.getResponseCode() != HttpURLConnection.HTTP_ACCEPTED
+                && httpConnection.getResponseCode() != HttpURLConnection.HTTP_CREATED )
             {
                 log.warn( "Couldn't send message, got response " + response + " " + getGatewayId() );
                 return false;