fix multi-message aspect of smsproto

passes --run-sms-test now, and works on Android occasionally combining messages.
This commit is contained in:
Eric House 2019-03-21 18:42:58 -07:00
parent ea1cc68eb0
commit 8a620533e5
2 changed files with 9 additions and 8 deletions

View file

@ -397,6 +397,8 @@ public class SMSService extends XWJIService {
sendBuffers( msgs, toPhone );
}
if ( waitSecs > 0 ) {
// PENDING
Log.d( TAG, "calling postResend(), but might want to avoid enqueueWork!" );
postResend( toPhone, waitSecs );
}
}

View file

@ -25,19 +25,18 @@
#include "comtypes.h"
#include "strutils.h"
# define MAX_WAIT 3
#define MAX_WAIT 3
// # define MAX_MSG_LEN 50 /* for testing */
# define MAX_LEN_BINARY 115
#define MAX_LEN_BINARY 115
/* PENDING: Might want to make SEND_NOW_SIZE smaller; might as well send now
if even the smallest new message is likely to put us over. */
# define SEND_NOW_SIZE MAX_LEN_BINARY
#define SEND_NOW_SIZE MAX_LEN_BINARY
/* To match the SMSService format */
# define SMS_PROTO_VERSION_JAVA 1
# define SMS_PROTO_VERSION_COMBO 2
# define SMS_PROTO_VERSION SMS_PROTO_VERSION_JAVA
#define SMS_PROTO_VERSION_JAVA 1
#define SMS_PROTO_VERSION_COMBO 2
# define PARTIALS_FORMAT 0
#define PARTIALS_FORMAT 0
typedef struct _MsgRec {
XP_U32 createSeconds;
@ -831,7 +830,7 @@ toNetMsgs( SMSProto* state, ToPhoneRec* rec, XP_Bool forceOld )
SMSMsgNet newMsg = { .len = useLen + 4,
.data = XP_MALLOC( state->mpool, useLen + 4 )
};
newMsg.data[0] = SMS_PROTO_VERSION;
newMsg.data[0] = SMS_PROTO_VERSION_JAVA;
newMsg.data[1] = msgID;
newMsg.data[2] = indx;
newMsg.data[3] = count;