Skip to content

Commit

Permalink
Remove hardcoded IP
Browse files Browse the repository at this point in the history
Replaced hardcoded IP with check for user's IP. Now works for people
whose ip addresses are not 192.168.1.141.
  • Loading branch information
ctbeiser committed Dec 13, 2012
1 parent 1afe45d commit 3beee0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miranda.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def listen(self,size,socket):
return False

#Create new UDP socket on ip, bound to port
def createNewListener(self,ip='192.168.1.141',port=1900):
def createNewListener(self,ip=gethostbyname(gethostname()),port=1900):
try:
newsock = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP)
newsock.setsockopt(SOL_SOCKET,SO_REUSEADDR,1)
Expand Down Expand Up @@ -799,7 +799,7 @@ def updateCmdCompleter(self,struct):
def msearch(argc, argv, hp, cycles=99999999):
defaultST = "upnp:rootdevice"
st = "schemas-upnp-org"
myip = '192.168.1.141'
myip = gethostbyname(gethostname())
lport = hp.port

if argc >= 3:
Expand Down

0 comments on commit 3beee0f

Please sign in to comment.