[Shtoom] about those patches
Zooko Wilcox-O'Hearn
zooko at zooko.com
Mon Sep 20 12:15:55 CEST 2004
> I've applied those patches to svn, thanks! I made one
> small change, which is to leave RTP_PT_CN parameterised
> for the firewall-seeding packet.
I think we can have it just as parameterizable, but simpler.
Your current code looks like this:
# Sane systems
RTP_PT_CN=13
# Cisco
#RTP_PT_CN=19
# No comfort noise at all
#RTP_PT_CN=None
...
class RTPProtocol(DatagramProtocol):
...
def sendFirstData(self):
...
if RTP_PT_CN is not None:
cnpt = RTP_PT_CN
else:
cnpt = 13
hdr = struct.pack('!BBHII', 0x80, cnpt, self.seq, self.ts,
self.ssrc)
I propose to change it to this:
# Sane systems
RTP_PT_CN=13
# Cisco
#RTP_PT_CN=19
# No comfort noise at all
#RTP_PT_CN=None
...
class RTPProtocol(DatagramProtocol):
...
def sendFirstData(self):
...
hdr = struct.pack('!BBHII', 0x80, RTP_PT_CN, self.seq, self.ts,
self.ssrc)
If you think this simpler version is less parameterizable, then perhaps
this is because you intended cnpt to be set at runtime? But as far as
I can tell, it isn't.
Regards,
Zooko
More information about the Shtoom
mailing list