On Mon, 2018-08-06 at 19:44 -0700, Michael Ducharme wrote:
> I am trying to fix this on my own but have spent probably 16 hours
> adding extra logging statements to try to figure out the flow in the
> GenieACS code to see the correct place to patch this and am still
> not sure, though I am still working on it.
Try the attached patch (not tested). This assumes the CPE at least
sends a DownloadResponse. If even that is too much to ask, try doing
something similar but somewhere in sendAcsRequest function.
> In my case the manufacturer has shown no interest in fixing it since
> they say the spec says that the ACS should handle the session being
> closed improperly in that way.
Not only does that not make sense, the spec actually says otherwise.
IIRC it explicitly states that changes made during a session should be
ignored if the session was not successfully closed.
> Shouldn't GenieACS be able to handle this? If TransferComplete is
> received, shouldn't that be good enough?
The problem is that a reference to the original download wasn't saved
in the database because DB sync happens at the end of the session.
--
Zaid Abdulla <[email protected]>
diff --git a/lib/cwmp.coffee b/lib/cwmp.coffee
index 20b9734..35de3a7 100644
--- a/lib/cwmp.coffee
+++ b/lib/cwmp.coffee
@@ -766,6 +766,9 @@ processRequest = (sessionContext, rpc) ->
else if rpc.cpeResponse
session.rpcResponse(sessionContext, rpc.id, rpc.cpeResponse, (err) ->
return throwError(err, sessionContext.httpResponse) if err
+ # Close and save session immediatly (CPE workaround)
+ if rpc.cpeResponse.name == "DownloadResponse"
+ return writeResponse(sessionContext, soap.response(null), true)
nextRpc(sessionContext)
)
else if rpc.cpeFault
_______________________________________________
Users mailing list
[email protected]
http://lists.genieacs.com/mailman/listinfo/users