Smack 4.4.8: Request of Bob data from sender has a long wait to receive the replied Bob data

aTalk release 4.1.0 implements XEP-0264: Jingle Content Thumbnails support for File Transfer protocol in both:
a. XEP-0234: Jingle File Transfer
b. XEP-0096: SI File Transfer

Upon received of a File Transfer Request with thumbnail element, a Bob data request is sent. However it is found that the requester needs to wait ~16s before the bob data is received, if the thumbnail size is set to 128 x 96. This long wait is not practical, as the recipient will likely to click the Accept button before even the thumbnail is received and displayed.

Following are the logcats captured while carried out test with swan sending a file transfer request to swordfish.

// ========= File transfer requester swan ==========
07:58:37.582  D  Thumbnail byteData: 17910
07:58:37.622  D  SENT (0): 
                 <iq to='swordfish@atalk.sytes.net/atalk-1tsh01p' id='E33RP-32' type='set'>
                   <si xmlns='http://jabber.org/protocol/si' id='jsi_1400349419' mime-type='image/jpeg' profile='http://jabber.org/protocol/si/profile/file-transfer'>
                     <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='1000001003.jpg' size='75036'>
                       <desc>
                         Sending file with thumbnail
                       </desc>
                       <thumbnail xmlns='urn:xmpp:thumbs:1' uri='cid:sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org' media-type='image/jpeg' width='128' height='96'/>
                     </file>
                     <feature xmlns="http://jabber.org/protocol/feature-neg">
                       <x xmlns='jabber:x:data' type='form'>
                         <field var='stream-method' type='list-single'>
                           <option>
                             <value>
                               http://jabber.org/protocol/bytestreams
                             </value>
                           </option>
                           <option>
                             <value>
                               http://jabber.org/protocol/ibb
                             </value>
                           </option>
                         </field>
                       </x>
                     </feature>
                   </si>
                 </iq>

07:58:37.751  D  RECV (0): 
                 <iq xml:lang='en' to='swan@atalk.sytes.net/atalk-1jgccqn' from='swordfish@atalk.sytes.net/atalk-1tsh01p' type='get' id='6YRF5-37'>
                   <data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org'/>
                 </iq>

07:58:37.849  D  SENT (0): 
                 <iq to='swordfish@atalk.sytes.net/atalk-1tsh01p' id='6YRF5-37' type='result'>
                   <data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org' max_age='86400' type='image/jpeg'>
07:58:37.849  D      /9j/4AAQSkZJRgABAQAAAQABAAD/kiqrWo5VZ27uuWdCy3jTJg+2n93tN0XuZjtnOT4/DVGBoRuFu2tHCowEGaVHh365w+HNl5T6vOja8rJ6McikR1aq/XWdtoL5/G2sxYFCDVELTqkLsFqKGcaNt2ZSFqu+1WqrYlltxsGzRfFW05qlypI37tqxqevF7N0QvWudUqf0YKCErsaTqkazEpmhyrHtg9qnqv6RyfXar5Z2/P6bkiYk8+a+kH6PNM1dO3GUxlhZYC705Y5bMIcJjMNZ/aLUcLf0qdrkKgx73H1ejXq0r2kbatbXFO7tqFRKyhCraLROutQ0c5a42+u7nM0M5eYrEVFy9/kro2SV8vYGrcWim8VFrvQSpaVFrpWo1Le4rI9JiRCyeSZM7y/yt3J59F1gfbnziJ8VVkd2tFjc3HI+pK5z4qxOtNC6T6UiMbYYxjZmo1G229DvkP+dtwLpYbxsucxsdVzmgzG80kxcjNzwDfslnnue7fFES81bP7/ABpyhuaUZ8K8KbFarNW8+T0G1N0fqfc0oY6evKbPD9P07b1poYrcFl4FXxuT5fU9ZsI+ORi/s+N7G/zYrFbI1yfJjmORPwgZLEF+eHKmkFxKRHD53zKyf6kbI4n/ACrr
                   </data>
// ========= File transfer recipient swordfish ==========
07:58:39.699  D  RECV (0): 
                 <iq xml:lang='en-US' to='swordfish@atalk.sytes.net/atalk-1tsh01p' from='swan@atalk.sytes.net/atalk-1jgccqn' type='set' id='E33RP-32'>
                   <si xmlns='http://jabber.org/protocol/si' id='jsi_1400349419' mime-type='image/jpeg' profile='http://jabber.org/protocol/si/profile/file-transfer'>
                     <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='1000001003.jpg' size='75036'>
                       <desc>
                         Sending file with thumbnail
                       </desc>
                       <thumbnail xmlns='urn:xmpp:thumbs:1' uri='cid:sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org' media-type='image/jpeg' width='128' height='96'/>
                     </file>
                     <feature xmlns='http://jabber.org/protocol/feature-neg'>
                       <x xmlns='jabber:x:data' type='form'>
                         <field var='stream-method' type='list-single'>
                           <option>
                             <value>
                               http://jabber.org/protocol/bytestreams
                             </value>
                           </option>
                           <option>
                             <value>
                               http://jabber.org/protocol/ibb
                             </value>
                           </option>
                         </field>
                       </x>
                     </feature>
                   </si>
                 </iq>
                 
07:58:39.787  D  SENT (0): 
                 <iq to='swan@atalk.sytes.net/atalk-1jgccqn' id='6YRF5-37' type='get'>
                   <data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org'/>
                 </iq> 

07:58:55.231  D  RECV (0): 
                 <iq xml:lang='en-US' to='swordfish@atalk.sytes.net/atalk-1tsh01p' from='swan@atalk.sytes.net/atalk-1jgccqn' type='result' id='6YRF5-37'>
                   <data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org' max_age='86400' type='image/jpeg'>
07:58:55.231  D      /9j/4AAQSkZJRgABAQAAAQABAAD
/h6eCcvv8xywLvHdexktB2vmvPatPLZvLTqA571U+QqEDzagnLaExejxWdF0bpTb0oJc7bpRxztDjqNhssG88lv8ADN+MXAH+PpGl2XyXnA7LtHNOdbQlpx+DGUs3ntrIZu254y0WKiFiiT/sx1GqSLS3aowkZpxyhC07ZKURk85Mt+cAezvide6JtfEA9Dt+2YLP6jDiz+XzIuteiPRhsY3R38noRNjcAk/TISRSnzG1RmDnKyhHDLZl8H1hz+aJ0X80nxn5HgPKbt3bfEzoNbkvXcntedZLNcrLA9cOubAFohTIjKrm1yWrDkaw6y7QUtBpNatw0HqW47d6NX2SWat89qU+lTXI2y1bvJJStqSXeJmnb+rZoLR6ZqszVa71ytu3q1WqrUFSpWpAptKqULViSUdilE+o224Id1VgHDbAAtL0zvJVIC7VDkMQunY/yJfF7L4rmta15Z6gfotx1sbx4FequxB2ofvFL2izlUdVzdeiFIR6choRIob9CocPAw9fU5ppAy0wYlCD
07:58:55.269  D    </data></iq>

From above it is found that the requester swan sends the bob data immediately after received the bob data request from swordfish. However swordfish receives the requested bob data only after a wait
of ~16s. On further checking with ejabberd log data, it indicates that swan actually segmented the bob data in sending. This is the cause of the delay, even though ejabberd relays the bob data in a single stanza sending.

Please advice if there is a way to get bob data sending without data segmentation to avoid the long delay wait.

2024-05-13 07:58:38.270456+08:00 [notice] <0.4433.2> (tls|<0.4433.2>) Received XML on stream = <<"<iq to='swan@atalk.sytes.net/atalk-1jgccqn' id='6YRF5-37' type='get'><data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org'/></iq>">>

2024-05-13 07:58:38.281664+08:00 [notice] <0.4438.2> (tls|<0.4438.2>) Send XML on stream = <<"<iq xml:lang='en' to='swan@atalk.sytes.net/atalk-1jgccqn' from='swordfish@atalk.sytes.net/atalk-1tsh01p' type='get' id='6YRF5-37'><data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org'/></iq>">>

2024-05-13 07:58:38.306607+08:00 [notice] <0.4438.2> (tls|<0.4438.2>) Received XML on stream = <<"<iq to='swordfish@atalk.sytes.net/atalk-1tsh01p' id='6YRF5-37' type='result'><data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org' max_age='86400' type='image/jpeg'>/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3Nw

2024-05-13 07:58:45.351467+08:00 [notice] <0.4438.2> (tls|<0.4438.2>) Received XML on stream = <<"GPvj0lsMsSfxr8nfGZvCuq57CT2QhMHmOvcsN7HVc0rVNl2KlsHgCmIFIPo6EvFln3o8roKkRmqR1DcEKKx0SyTWjdG1McPGMhyjnnP69/qxbk0cW855mxM2eh2OHNWTgSbp5yDR1N4Fq7ppvF6qTmR0k2kQQDXKuHvH0muEl4ist8xba3IDKpIIEe5uw/I+Ij+R1Q2aye73XCll3R+wt+C8b2BFIHcxklpmSYInpWi

2024-05-13 07:58:53.544397+08:00 [notice] <0.4438.2> (tls|<0.4438.2>) Received XML on stream =
L2krFf8Au16NX0mhOodP0jtxWuNL4yzksbSndYasnrVKj1K9UMb5DurPULtIPuJIksehV03qZua+ldRV6hgeo2JyO4KoVVUA2pJCgAAlgADAHAl4uv8A5S4Ll3jH1ryUi8xfHnWN5iZoCKPLcuVsGNjsYyhUAOSzUl+9hjF3R6GJnFBctS6lG0Nv0UvzzsesaH+GUL2eTfMGRyr9GIwQb8FX5NcjsyaX+Pv369K5fkvpF9qn4y3+GPkHDLCrMHSWN0ci/JN7zn4qqfFGr6drkVfS+/f+ntU/f36/HQlx7C8PteJ/LoNJzrHePx7xiFS6+0dtGAu2KdJ6HoMwMz+/sMMgpyBKih+5ZZoI1K6OrXEWAlQOOCXsjQnWDJay1vbWOBucda5Cy1fWz1HJ4qpUxWS09bHDUquEvjSuri0bKC9yBuL6nRs6Nrjbe6u3rXaRRRKZZtdo3RmSr520yF9Z32nqOGvMXkkXJYjMBcg1LLWIq2tK5SwNra+hbNWu61zf1ra3Sjbud7MYH//Z</data></iq>

2024-05-13 07:58:53.572463+08:00 [notice] <0.4433.2> (tls|<0.4433.2>) Send XML on stream = <<"<iq xml:lang='en-US' to='swordfish@atalk.sytes.net/atalk-1tsh01p' from='swan@atalk.sytes.net/atalk-1jgccqn' type='result' id='6YRF5-37'><data xmlns='urn:xmpp:bob' cid='sha1+5222d9938627302cc16ac8a7b587be40880b1dc8@bob.xmpp.org' max_age='86400' type='image/jpeg'>/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADb/2w
sMMgpyBKih+5ZZoI1K6OrXEWAlQOOCXsjQnWDJay1vbWOBucda5Cy1fWz1HJ4qpUxWS09bHDUquEvjSuri0bKC9yBuL6nRs6Nrjbe6u3rXaRRRKZZtdo3RmSr520yF9Z32nqOGvMXkkXJYjMBcg1LLWIq2tK5SwNra+hbNWu61zf1ra3Sjbud7MYH//Z</data></iq>">>
1 Like