Commit 48736f78 authored by nextime's avatar nextime

Permit 2 args bool STATUS conditions int assuming equality test

parent 1d729abe
......@@ -1113,7 +1113,12 @@ class domotikaService(service.Service):
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)"+st['1']+st[2], restype)
except:
pass
elif restype in ['bool','int'] and len(st)==2 and genutils.is_number(st[1]):
try:
ret=doQuery("""SELECT COUNT(value) FROM statusrealtime
WHERE DMDOMAIN(status_name, """+str(st[0])+")=1 AND CONVERT(value, SIGNED)="+st['1'], restype)
except:
pass
elif restype=='string' and len(st)>0:
try:
ret=doQuery("SELECT value FROM statusrealtime WHERE DMDOMAIN(status_name,'"+str(st[0])+"')=1", restype=False)
......
......@@ -78,6 +78,7 @@ class WebProxyClient(ProxyClient):
headers["connection"] = "close"
headers.pop('keep-alive', None)
self.headers = headers
log.debug("Proxy Client SEND headers: "+str(headers))
ProxyClient.__init__(self,
command=command,
rest=rest,
......@@ -126,18 +127,17 @@ class WebProxyResource(ReverseProxyResource):
def __init__(self, *arg, **kwarg):
log.debug("WebProxy called")
#try:
if True:
try:
if 'remove' in kwarg.keys():
self.remove=int(kwarg['remove'])
del kwarg['remove']
#except:
# log.debug("error in remove")
except:
log.debug("error in remove")
return ReverseProxyResource.__init__(self, *arg, **kwarg)
def getChild(self, path, request):
log.debug("APACHE PROXY SEND HEADERS "+str(request.requestHeaders))
#log.debug("APACHE PROXY SEND HEADERS "+str(request.requestHeaders))
#return ReverseProxyResource.getChild(self, path, request)
return WebProxyResource(self.host, self.port, self.path+'/'+urlquote(path, safe=""), remove=self.remove)
......@@ -153,6 +153,8 @@ class WebProxyResource(ReverseProxyResource):
headerhost=request.getHeader('host')
headers['host'] = hostport(self.host, self.port, headerhost)
log.debug("APACHE PROXY / SEND HEADERS "+str(request.requestHeaders))
try:
request.content.seek(0, 0)
reqdata=request.content.read()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment