aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2006-07-08 20:02:48 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-07-08 20:02:48 +0000
commite81a7357ed63dbaeec9debe877f3be2179011683 (patch)
tree87db8c7973445351b0bfd5878bf2373acc23cb7d /classes
parentf245bc2dd0ed9fa843a89120f0b72de2f7944463 (diff)
downloadopenembedded-e81a7357ed63dbaeec9debe877f3be2179011683.tar.gz
class/tinderclient.bbclass: Send bigger files in smaller chunks to avoid broken firewalls
Thanks to the firewall fascists of A???? longer HTTP requests were lost in the corporate firewall. Avoid this situation by sending the data in smaller chunks.
Diffstat (limited to 'classes')
-rw-r--r--classes/tinderclient.bbclass20
1 files changed, 13 insertions, 7 deletions
diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass
index 6e10d0f34b..f544c203fe 100644
--- a/classes/tinderclient.bbclass
+++ b/classes/tinderclient.bbclass
@@ -13,12 +13,15 @@ def tinder_http_post(server, selector, content_type, body):
#print errcode, errmsg, headers
return (errcode,errmsg, headers, h.file)
except:
+ print "Error sending the report!"
# try again
pass
+ # return some garbage
+ return (-1, "unknown", "unknown", None)
+
def tinder_form_data(bound, dict, log):
output = []
- #br
# for each key in the dictionary
for name in dict:
output.append( "--" + bound )
@@ -119,7 +122,7 @@ def tinder_build_start(d):
f.write(report)
-def tinder_send_http(d, status, log):
+def tinder_send_http(d, status, _log):
"""
Send this log as build status
"""
@@ -127,16 +130,19 @@ def tinder_send_http(d, status, log):
# get the body and type
- content_type, body = tinder_format_http_post(d,status,log)
server = data.getVar('TINDER_HOST', d, True )
url = data.getVar('TINDER_URL', d, True )
selector = url + "/xml/build_status.pl"
- # now post it
- errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body)
- #print errcode, errmsg, headers
- #print h.file.read()
+ # now post it - in chunks of 10.000 charachters
+ new_log = _log
+ while len(new_log) > 0:
+ content_type, body = tinder_format_http_post(d,status,new_log[0:18000])
+ errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body)
+ #print errcode, errmsg, headers
+ #print h.file.read()
+ new_log = new_log[18000:]
def tinder_print_info(d):